We are currently in alpha version.
Please expect changes. If you find any issues, please report them on our github.
Date picker
Date pickers are intuitive UI elements that allow users to date picker dates with ease. They provide a clear, interactive way to choose single or multiple dates, improving form usability and scheduling interactions.
Basic date picker
Preview
Code
Date range picker
Preview
Code
Date range without dropdown and weekends
Preview
Code
Optional properties
Property | Type | Description |
---|---|---|
|
| Controls date picker sizing. |
|
| Defines the date picker shape. |
| string | Specifies a Font Awesome class for the date picker's icon (e.g., |
|
| Sets the icon's position relative to the date picker text. Defaults to |
|
| Sets the position of the date picker options. |
| boolean |
|
| boolean | Setting this to |
| boolean |
|
| boolean |
|
| string | Defines the id of the date picker. |
| string | Defines the label attached to the date picker. |
| string | Defines the placeholder of the date picker. |
| string | Defines the help text of the date picker. |
| ZapDatePickerBreakpoints | Sets the breakpoints for the date picker. Accepts an object with properties for different screen sizes. |
| number | Specifies how many months are displayed at a time in the view. |
| number | Sets the maximum number of months displayed per row. Works only when |
| string | Sets the date format of the date picker. Defaults to |
| string | Sets the locale of the date picker. Defaults to |
| string[] | Sets the months of the date picker. Order is important and reflected in the view. Defaults to |
| string[] | Defines the labels for the days of the week in the date picker. The order of the array determines how they appear in the view. By default, it follows the standard format: |
| Date[] | Disables specific dates in the date picker. Accepts an array of |
| { startDate: Date; endDate: Date }[] | Disables specific date ranges in the date picker. Accepts an array of objects with startDate and endDate properties. |
| Date | Sets the minimum date pickerable date in the date picker. |
| Date | Sets the maximum date pickerable date in the date picker. |
| number | Sets the minimum date pickerable year in the date picker. |
| number | Sets the maximum date pickerable year in the date picker. |
| string[] | Defines the range of years available for date pickerion in the date picker. The order of the years in the array determines how they appear in the dropdown. By default, it includes the current year, along with the previous and next 50 years. |
| string | Provides the ability to set custom error messages. |
| string | Allows overriding default styles by passing Tailwind CSS classes. Utilize the |
Supported directives
Selector | Directive name | Description |
---|---|---|
| ZapFormFieldIconDirective | Import a directive |
| ZapFormFieldHelpTextDirective | Import a directive |
| ZapLabelDirective | Import a directive |
Example
Preview
Code
date picker data range
For accurate results:
date picker data not earlier than 2000
date picker data not later than 2024
Global configurations
A list of global styles, including shape, size, color, font sizes, font weights, and letter spacing can be provided via themeLibrary
in the provideZapOption
provider.. If you have multi theme setup, you can also provide theme specific colors. These apply to all default variants through out the app unless component level styles are provided.
Example
app.config.ts
Shape - date-picker
Property | Description |
---|---|
| Defines the shape of the date picker. Can be |
Shape - dp-calendar
Property | Description |
---|---|
| Defines the shape of the date picker. Can be |
Shape - dp-calendar-date picker
Property | Description |
---|---|
| Defines the shape of the date picker. Can be |
Colors - date-picker
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Icon color of the date picker. |
| Background color of the date picker. |
| Text color of the date picker. |
| Border color of the date picker. |
| Color of the text on hover |
| Background color of the date picker when hovered. |
| Ring color of the date picker when focused. |
| Text color of the placeholder |
| Text color of the label |
| Text color of the help text |
| Background color of the date picker when disabled. |
| Border color of the date picker when disabled. |
| Text color of the date picker when disabled. |
| Color of the label when disabled. |
| Color of the help text when disabled. |
Colors - dp-calendar
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Border color of the date picker. |
| Border color of the handler of the date picker. |
| Background color of the handler of the date picker. |
| Color of the handler in the date picker. |
| Background color of the handler when hovered in the date picker. |
| Border color of the handler when hovered in the date picker. |
| Text color of the day element in the date picker. |
| Background color of the day element in the date picker. |
| Border color of the day element in the date picker. |
| Text color of the day element when hovered. |
| Background color of the day element when hovered. |
| Border color of the day element when hovered. |
| Text color of the day-of-week elements in the date picker. |
| Background color of the day-of-week elements in the date picker. |
| Border color of the day-of-week elements in the date picker. |
| Text color of the day-of-week elements when hovered. |
| Background color of the day-of-week elements when hovered. |
| Border color of the day-of-week elements when hovered. |
| Background color of the day elements that fall within the selected range. |
| Border color of the day elements that fall within the selected range. |
| Text color of the day elements that fall within the selected range. |
| Background color of day elements that belong to the active month. |
| Border color of day elements that belong to the active month. |
| Text color of day elements that belong to the active month. |
| Text color of day elements that belong to the active month when hovered. |
| Background color of day elements that belong to the active month when hovered. |
| Border color of day elements that belong to the active month when hovered. |
| Text color of the day element representing today. |
| Background color of the day element representing today. |
| Border color of the day element representing today. |
| Text color of the day element representing today when hovered. |
| Background color of the day element representing today when hovered. |
| Border color of the day element representing today when hovered. |
| Background color of day elements in the active month when they fall within the selected range. |
| Border color of day elements in the active month when they fall within the selected range. |
| Text color of day elements in the active month when they fall within the selected range. |
| Background color of the selected day elements in the active month. |
| Border color of the selected day elements in the active month. |
| Text color of the selected day elements in the active month. |
| Text color of the selected day elements in the active month when hovered. |
| Background color of the selected day elements in the active month when hovered. |
| Border color of the selected day elements in the active month when hovered. |
| Background color of the selected day elements. |
| Border color of the selected day elements. |
| Text color of the selected day elements. |
| Text color of the selected day elements when hovered. |
| Background color of the selected day elements when hovered. |
| Border color of the selected day elements when hovered. |
Colors - dp-calendar-select
You can provide each of these colors for different themes that you use
Property | Description |
---|---|
| Background color of the date picker. |
| Text color of the date picker. |
| Border color of the date picker. |
| Background color of the date picker when hovered. |
| Color of the text on hover |
| Border color of the date picker when hovered. |
| Background color of the options dropdown in the date picker. |
| Text color of the options dropdown in the date picker. |
| Border color of the options dropdown in the date picker. |
| Text color of an individual option in the date picker dropdown. |
| Background color of an individual option in the date picker dropdown. |
| Border color of an individual option in the date picker dropdown. |
| Background color of an individual option in the date picker dropdown when hovered. |
| Text color of an individual option in the date picker dropdown when hovered. |
| Border color of an individual option in the date picker dropdown when hovered. |
| Text color of the selected option in the date picker dropdown. |
| Background color of the selected option in the date picker dropdown. |
| Border color of the selected option in the date picker dropdown. |
| Background color of the selected option in the date picker dropdown when hovered. |
Other styles - date-picker
You can provide a bunch of other styles, that are not theme based but rather generic
Property | Description |
---|---|
| Defines the radius of the date picker's corners. |
| Left padding of the date picker. |
| Right padding of the date picker. |
| Top padding of the date picker. |
| Bottom padding of the date picker. |
| Padding around the date picker's content. |
| Font size of the date picker's placeholder. |
| Font weight of the date picker's placeholder. |
| Line height of the date picker's placeholder. |
| Letter spacing of the date picker's placeholder. |
| Font size of the date picker's label. |
| Font weight of the date picker's label. |
| Line height of the date picker's label. |
| Letter spacing of the date picker's label. |
| Font size of the date picker's help text. |
| Font weight of the date picker's help text. |
| Line height of the date picker's help text. |
| Letter spacing of the date picker's help text. |
Other styles - dp-calendar
You can provide a bunch of other styles, that are not theme based but rather generic
Property | Description |
---|---|
| Defines the radius of the calendar's corners. |
| Left padding of the calendar. |
| Right padding of the calendar. |
| Top padding of the calendar. |
| Bottom padding of the calendar. |
| Padding around the calendar's content. |
| Defines the border radius of the calendar handler. |
| Specifies the height of the calendar handler. |
| Specifies the width of the calendar handler. |
| Defines the left padding of the calendar handler. |
| Defines the right padding of the calendar handler. |
| Defines the top padding of the calendar handler. |
| Defines the bottom padding of the calendar handler. |
| Specifies the overall padding applied to the calendar handler. |
| Defines the height of individual day elements in the calendar. |
| Defines the width of individual day elements in the calendar. |
| Defines the border radius of individual day elements in the calendar. |
| Specifies the height of day-of-week elements in the calendar. |
| Specifies the width of day-of-week elements in the calendar. |
| Defines the border radius of day-of-week elements in the calendar. |
Other styles - dp-calendar-select
You can provide a bunch of other styles, that are not theme based but rather generic
Property | Description |
---|---|
| Defines the border radius of the select dropdown in the calendar. |
| Specifies the left padding inside the select dropdown. |
| Specifies the right padding inside the select dropdown. |
| Defines the top padding inside the select dropdown. |
| Defines the bottom padding inside the select dropdown. |
| Specifies the overall padding applied to the select dropdown. |
| Defines the font size of the text inside the select dropdown. |
| Sets the font weight of the text inside the select dropdown. |
| Defines the line height of text inside the select dropdown. |
| Specifies the letter spacing of text inside the select dropdown. |
| Defines the border radius of the options within the select dropdown. |
| Specifies the left padding inside each option in the select dropdown. |
| Specifies the right padding inside each option in the select dropdown. |
| Defines the top padding inside each option in the select dropdown. |
| Defines the bottom padding inside each option in the select dropdown. |
| Specifies the overall padding applied to each option in the select dropdown. |
| Defines the font size of the options in the select dropdown. |
| Sets the font weight of the options in the select dropdown. |
| Defines the line height of the options in the select dropdown. |
| Specifies the letter spacing of the options in the select dropdown. |
| Defines the font size of the selected option in the select dropdown. |
| Sets the font weight of the selected option in the select dropdown. |
| Defines the line height of the selected option in the select dropdown. |
| Specifies the letter spacing of the selected option in the select dropdown. |