Date Picker
Input-triggered date picker with three variants: click-to-pick, date range, and a typed DD/MM/YYYY field. The calendar drops below the input (or above if space is tight), animated with a blurred slide. For the standalone calendar component, see Calendar.
Installation
npx stepwise-ui add date-picker
Date
Pick a date
Date range
Pick a date range
Date of birth
Variants
PropTypeDescription
datevariantClick the input to open a calendar. Selecting a date fills the input and closes the picker.
rangevariantOpens a range calendar. First click sets start, second sets end. Hover previews the range.
textvariantType a date as DD/MM/YYYY. The calendar icon also opens the visual picker - both update the same value.
Props
PropTypeDescription
variant"date" | "range" | "text"Picker variant. Default: "date".
labelstringLabel shown above the input.
placeholderstringPlaceholder text. Defaults to a sensible value per variant.
valueDate | nullControlled date value (date and text variants).
onChange(date: Date | null) => voidCalled when the date changes.
fromDate | nullRange start date (range variant).
toDate | nullRange end date (range variant).
onRangeChange(from: Date | null, to: Date | null) => voidCalled when either range endpoint changes.
classNamestringAdditional classes for the outer wrapper.