Date Picker
A dropdown date field that wraps Calendar in a select-style trigger — single date or start/end range, with a formatted display label and full Angular Forms (CVA) integration.
API
All inputs and configuration options for zyra-date-picker.
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | { start: Date | null; end: Date | null } | null | null | Two-way bound selection via [(value)] or ngModel — shape depends on selectionMode |
selectionMode | 'single' | 'range' | 'single' | Controls the selection behavior and the shape of value |
appearance | 'outline' | 'filled' | 'underline' | 'outline' | Trigger chrome style |
size | 'sm' | 'md' | 'lg' | 'md' | Trigger height and font scale |
placeholder | string | 'Select date' | Shown in the trigger when no value is selected |
min | Date | null | null | Dates before this are disabled (passed through to Calendar) |
max | Date | null | null | Dates after this are disabled (passed through to Calendar) |
closeOnSelect | boolean | true | Closes the panel once a full selection is made |
clearable | boolean | true | Shows an inline clear (×) button in the trigger once a value is set |
disabled | boolean | false | Disables the trigger and panel |
opened (output) | void | - | Emits when the panel opens |
closed (output) | void | - | Emits when the panel closes |
Tokens
CSS custom properties zyra-date-picker reads at runtime — override any of these in your own stylesheet after @use 'zyra-ng-ui'; to restyle it without touching the component itself.
| Token | Default points to | Description |
|---|---|---|
Text--zyra-color-select-text | var(--zyra-color-foreground) | Color of the selected value / chip text in the trigger. |
Placeholder--zyra-color-select-placeholder | var(--zyra-color-foreground-subtle) | Color of the placeholder text when nothing is selected. |
Icon--zyra-color-select-icon | var(--zyra-color-foreground-subtle) | Color of the chevron/caret icon. |
Background--zyra-color-select-bg | var(--zyra-color-input-bg) | Fill color of the trigger in the outline/filled appearances. |
Border--zyra-color-select-border | var(--zyra-color-input-border) | Border color of the trigger in its resting state. |
Filled background--zyra-color-select-filled-bg | var(--zyra-color-surface-inset) | Fill color specific to the filled appearance. |
Focus border--zyra-color-select-focus-border | var(--zyra-color-primary) | Border/underline color of the trigger when focused or open. |
Panel background--zyra-color-select-panel-bg | var(--zyra-color-surface-dropdown) | Fill color of the options panel. |
Panel border--zyra-color-select-panel-border | var(--zyra-color-border-color) | Border color of the options panel. |
Accessibility
Built to meet WCAG 2.0 AA. These notes cover the key ARIA, keyboard, and interaction behaviours.
- Trigger has aria-haspopup="dialog" and reflects aria-expanded
- Panel is role="dialog" and inert while closed
- ArrowDown/Enter/Space opens the panel, Escape closes it, Tab closes and moves on
- Clicking outside the trigger and panel closes it
- Calendar's own keyboard grid navigation (arrow keys, roving tabindex) applies inside the panel