Datepicker
<dsx-datepicker> — Datepicker
Section titled “<dsx-datepicker> — Datepicker”Text input plus calendar popover that stores dates as ISO strings (yyyy-mm-dd).
Live Preview
Import
Section titled “Import”import '@bnotk/dsx/components/datepicker.js';<dsx-datepicker value="2025-08-15" min="2025-08-01" max="2025-08-31"></dsx-datepicker>Elements
Section titled “Elements”<dsx-datepicker>
Section titled “<dsx-datepicker>”Inline date picker with formatted text input and month-view calendar overlay.
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
| value | string | ” | Selected date stored as yyyy-mm-dd. |
| min | string | ” | Minimum selectable date as yyyy-mm-dd. |
| max | string | ” | Maximum selectable date as yyyy-mm-dd. |
| placeholder | string | ’dd.mm.yyyy’ | Placeholder shown in the text input when no value is selected. |
| disabled | boolean | false | Disables the text input and calendar button. |
Methods
Section titled “Methods”None.
Events
Section titled “Events”| Event | Detail | Description |
|---|---|---|
| dsx-change | { value: string } | Bubbles/composed when a valid date is entered or a day is selected. |
None.
CSS Parts
Section titled “CSS Parts”This element does not expose shadow parts.
- The text input accepts either
dd.mm.yyyyoryyyy-mm-ddon thechangeevent. - The calendar always renders 42 day cells and starts weeks on Monday.
- Month labels use
toLocaleDateString("de-DE", { month: "long", year: "numeric" }).
Behavior Notes
Section titled “Behavior Notes”- Opening the calendar focuses on the month of the current
valuewhen one is present; otherwise it starts at today’s month. - Selecting a day closes the calendar and emits
dsx-changewith the ISO date string. - Dates before
minor aftermaxreceive thedisabledclass and ignore clicks. - The visible input value is always formatted as
dd.mm.yyyywhile the property remains ISO.
Styling Notes
Section titled “Styling Notes”- The control uses an inset border shadow and a focus ring with
--ds2-color-focuson:focus-within. - Calendar popover sits directly below the input wrapper and uses the standard dropdown tokens for border, surface, and shadow.
- Selected days use the main brand color; today uses bold text plus the main color.