Default
Show the codeHide the code
Default, code
<DatePicker
label="Delivery date"
defaultValue={parseDate('2026-10-24')}
hint="We deliver Monday to Saturday."
/>A date field with a calendar button: type the date or pick it from a month grid.
Still previews of the real component, rendered from its stories. Pro code isn’t public, so nothing in them responds. Switch the theme and density for every preview at once.
Default, code
<DatePicker
label="Delivery date"
defaultValue={parseDate('2026-10-24')}
hint="We deliver Monday to Saturday."
/>Open, code
<DatePicker label="Delivery date" defaultValue={parseDate('2026-10-24')} defaultOpen />Empty, code
<DatePicker label="Start date" />Invalid, code
<DatePicker
label="Delivery date"
isRequired
isInvalid
errorMessage="Choose a delivery date"
/>Disabled, code
<DatePicker label="Delivery date" isDisabled defaultValue={parseDate('2026-10-24')} />Range, code
<DateRangePicker label="Trip dates" defaultValue={{ start: parseDate('2026-10-12'), end: parseDate('2026-10-16') }} />Range, open, code
<DateRangePicker label="Trip dates" defaultOpen defaultValue={{ start: parseDate('2026-10-12'), end: parseDate('2026-10-16') }} />The 8 design tokens DatePicker reads, with the value each has in the theme and density chosen above. Change a token and the component follows, in Figma and in code.
| Token | Value now | CSS variable |
|---|---|---|
| color.bg.muted | … | --sd-color-bg-muted |
| color.bg.subtle | … | --sd-color-bg-subtle |
| color.icon.default | … | --sd-color-icon-default |
| color.text.secondary | … | --sd-color-text-secondary |
| input.height | … | --sd-input-height |
| input.radius | … | --sd-input-radius |
| spacing.inset.md | … | --sd-spacing-inset-md |
| target.min | … | --sd-target-min |
Pro components come as source from the SuperDuper registry, with a licence key from Solo, Team or Studio. The registry and checkout aren’t open yet.
Add it from the registry (Pro licence key)
npx shadcn@latest add @superduperui/date-pickerThen import it
import { DatePicker, DateRangePicker } from "@/components/ui/date-picker"| Prop | Type | What it does |
|---|---|---|
labelrequired | string | Visible label (required). |
hint | string | |
errorMessage | string | ((validation: ValidationResult) => string) | |
hideLabel | boolean | Keep the label for assistive technology but hide it visually. |
Screen readers announce "Delivery date, group"; on open "Saturday, 24 October 2026, selected, button".
WCAG 2.2 AAA criteria the component meets in Comfortable density: 1.4.6, 1.4.9, 2.1.3, 2.3.2, 2.4.13, 2.5.5, 2.5.6, 2.3.3.
Compact density meets AA (2.5.8, 24px targets), not AAA.
Shared patterns it ships with: 3.3.5 (hint states the rules); 3.3.6 (invalid dates are explained, never cleared).
| axe-core (WCAG A, AA, AAA and best practice) | 160 runs across every story, theme, density and width: 0 violations |
|---|---|
| Rendered text contrast | 1,145 text runs: 0 below 7:1, lowest 8.43:1 |
| Target size | 288 targets: 0 under 44px in Comfortable |
| Focus appearance (2.4.13) | 72 focus stops in 3 browser engines: all pass |
| Keyboard script | Chromium 6 of 6, Firefox 6 of 6, WebKit 6 of 6 |
Manual passes with VoiceOver and NVDA haven’t been done yet.
Each step is scripted and run in Chromium, Firefox and WebKit.
| Key | What happens |
|---|---|
| Tab | Tab reaches the day segment |
| Alt+ArrowDown | Alt+Down opens the calendar with focus on the selected day |
| ArrowLeft | Left moves one day back |
| Enter | Enter picks the day, closes the calendar and fills the segments |
| Alt+ArrowDown | Alt+Down opens it again |
| Escape | Esc closes without changing the date |
The Figma component is DatePicker, with Mode (Single, Range); State (Default, Hover, Focus, Open, Disabled, Invalid); Label visibility (Visible, Hidden); Content (Placeholder, Value). The Figma library isn’t published yet.
Figma to code: Mode (Single = DatePicker, Range = DateRangePicker); State (Default, Hover, Focus, Open = defaultOpen, Disabled = isDisabled, Invalid = isInvalid); Label visibility → hideLabel (Visible = false, Hidden = true); Content (Placeholder, Value; preview only); Value → defaultValue; nested Label → label; nested Hint → hint; nested FieldError → errorMessage.