Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngx-mat-birthday-input

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-mat-birthday-input

An Angular Material package for entering a birthday. I split a date into 3 input fields, day, month and year, then reassemble and save them into a given formControl

  • 17.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

NgxMatBirthdayInput

An Angular Material package for entering a birthday. I split a date into 3 input fields, day, month and year, then reassemble and save them into a given formControl

The UI is based on the Vitaly Friedman article, Designing Birthday Picker UX: Simpler Is Better

Input example

Supports:

  • Angular >=15
  • Angular Material >=15

Installation

npm i ngx-mat-birthday-input

Usage

Import

Add NgxMatBirthdayInputComponent to your component file:

imports: [NgxMatBirthdayInputComponent];

Example

  • Add floatLabel to your mat-form-field
  • Use a preset formControlName
  • This formControlName will be automatically updated, therefore giving you the possibility to add your own mat-error see the comment
<form #f="ngForm" [formGroup]="birthdayForm">
  <mat-form-field
    floatLabel="always"
  >
    <!-- <mat-label>Birthday</mat-label> -->

    <ngx-mat-birthday-input
      formControlName="birthday"
      id="birthday"
    >
    </ngx-mat-birthday-input>

    <!-- <mat-icon matSuffix>event</mat-icon>
    <mat-error *ngIf="authRegistrationService.itemForm?.get('birthday').invalid">
      {{ Invalide error message }}
    </mat-error> -->
  </mat-form-field>
</form>

Options

OptionsTypeDefaultDescription
formControlNameFormControlundefinedValue to be updated
autocomplete"on" or "off""on"Use the default browser autofill
labelsstring[]["DD", "MM", "YYYY"]Label used by the mat-input
placeholdersstring[]undefined@TODO
requiredbooleanundefined@TODO
disabledbooleanundefined@TODO

Css variable

NameDefaultExplanation
--ngx-mat-birthday-input-gap16pxChange the gap between the inputs

Authors and acknowledgment

BuyMeACoffee

FAQs

Package last updated on 21 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc