A locale-aware date input with an optional floating calendar, mask input, and native date form value.
Package@g4rcez/componentsSectionForm Controls
Examples
Basic Date Picker
Renders a masked text input with a calendar dropdown trigger. Submits a hidden ISO date value.
Basic
Controlled Value
Pass date and onChange to control the selected date externally.
Controlled
Date Range Picker
Pass range to render editable endpoint inputs and a calendar header that uses labelRange, with presets, staged selection, and Apply/Cancel actions.
Range
null
Localized Range Picker
Override rangeLabels for non-English preset-list, action, and Today labels.
Localized
Custom Presets
Provide rangePresets to replace the default menu with product-specific date shortcuts.
Custom presets
Inline Calendar
Set floating=false to render the calendar inline instead of in a dropdown.
Inline
Sun
Mon
Tue
Wed
Thu
Fri
Sat
When to use Date Picker
Use when
You need the documented Date Picker interaction or presentation in a product workflow.
Avoid when
A native HTML element already provides the Date Picker behavior you need.
Accessibility
Keep the Date Picker labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.
data-component="date-picker": visible field or range fieldset.
data-value: formatted selected value on the field or range fieldset.
data-target: the associated name value.
data-origin: the original field name of the hidden native input.
Design tokens
Geometry defaults are scoped calc fallbacks from --var-spacing-base and the independent --var-radius-base. Explicit semantic overrides win. See Geometry tokens for default lookup, radius migration, theme emission, and exceptions. The first table lists examples. defaultGeometryTokens holds the full set.
Date Picker tokens Override reference
Override
Library default
--var-date-picker-calendar-icon-size
calc(var(--var-spacing-base) * 1)
--var-date-picker-range-nights-radius
calc(var(--var-radius-base) / 4)
--var-card-surface-radius
calc(var(--var-radius-base) * 0.75)
--var-date-picker-panel-gap
calc(var(--var-spacing-base) * 1)
CSS contracts: date-picker, input, input-field, calendar, and dropdown. Import foundation.css before those chunks, or use index.css. Customize the semantic --var-* variables, not generated utility selectors.
Accessibility
Keep the Date Picker labeled and use its documented keyboard interaction. The component preserves visible focus and communicates state without relying on color alone.
InputField labels the visible field.
Calendar controls support the keyboard and expose selected and disabled states.
The calendar trigger has a translated accessible label.