Date Picker
A date picker combining Popover and Calendar with single, multiple, and range selection.
A date picker that composes Popover and Calendar with single, multiple, and range selection while keeping open, selection value, and visible month independently controllable. The examples on this page use the Shadcn Rhea style preset.
Preview
Section titled “Preview”<div class="flex flex-col items-start gap-2">
<proto-ui-shadcn-date-picker-root id="dp-shadcn">
<proto-ui-shadcn-date-picker-trigger class="w-56">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn');
setElementProps(root, {
defaultMonth: '2026-10',
today: '2026-10-15',
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'Pick a date' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>Installation
Section titled “Installation”Available starting in 0.3.0-rc.1 and later releases. Date Picker is composed from Popover and Calendar parts imported directly from the workspace.
import { ShadcnDatePickerRoot, ShadcnDatePickerTrigger, ShadcnDatePickerValue, ShadcnDatePickerContent, ShadcnDatePickerDay, ShadcnCalendarCaption, ShadcnCalendarPrevious, ShadcnCalendarHeading, ShadcnCalendarNext, ShadcnCalendarGrid, ShadcnCalendarWeekdays, ShadcnCalendarWeekday, ShadcnCalendarRow,} from '../proto-ui/components/react';
export function DatePickerExample() { return ( <ShadcnDatePickerRoot defaultMonth="2026-10" styleProfile="rhea"> <ShadcnDatePickerTrigger className="w-56"> <ShadcnDatePickerValue placeholder="Pick a date" /> <span aria-hidden="true">▾</span> </ShadcnDatePickerTrigger> <ShadcnDatePickerContent side="bottom" align="start" sideOffset={6}> <ShadcnCalendarCaption> <ShadcnCalendarPrevious a11yLabel="Previous month">‹</ShadcnCalendarPrevious> <ShadcnCalendarHeading /> <ShadcnCalendarNext a11yLabel="Next month">›</ShadcnCalendarNext> </ShadcnCalendarCaption> <ShadcnCalendarGrid> <ShadcnCalendarWeekdays> {[0, 1, 2, 3, 4, 5, 6].map((offset) => ( <ShadcnCalendarWeekday key={offset} offset={offset} /> ))} </ShadcnCalendarWeekdays> {[0, 1, 2, 3, 4, 5].map((row) => ( <ShadcnCalendarRow key={row} index={row}> {[0, 1, 2, 3, 4, 5, 6].map((col) => ( <ShadcnDatePickerDay key={col} offset={row * 7 + col} /> ))} </ShadcnCalendarRow> ))} </ShadcnCalendarGrid> </ShadcnDatePickerContent> </ShadcnDatePickerRoot> );}Composition
Section titled “Composition”DatePickerRoot├── DatePickerTrigger│ └── DatePickerValue└── DatePickerContent ├── CalendarCaption │ ├── CalendarPrevious │ ├── CalendarHeading │ └── CalendarNext └── CalendarGrid ├── CalendarWeekdays -> CalendarWeekday (0..6) └── CalendarRow (0..5) -> DatePickerDay (0..41)Selection modes and dismissal
Section titled “Selection modes and dismissal”- Single and range modes:
mode="single"requests closing the popover once a date is accepted.mode="range"keeps the popover open after choosing the start date and requests one close when the second endpoint completes the range. If a controlled selection request is rejected or pending, the popover stays open. - Multiple mode:
mode="multiple"keeps the popover open so users can toggle several dates, then close it via outside click orEscape. - Formatted display (
Value): Empty selections renderplaceholderwith muted placeholder text styling; single mode formatsYYYY-MM-DD, multiple mode formats a sorted comma-separated list, and range mode formatsfrom …while incomplete orfrom – toonce complete. - Keyboard and accessibility: Dismissal and focus restoration are managed by
Popover; grid arrow navigation, unavailable date skipping, and localized labels are inherited from Calendar.
Examples
Section titled “Examples”A labeled single-date picker with min and max date boundaries.
<div class="flex flex-col items-start gap-2">
<span class="text-sm font-medium">Date</span>
<proto-ui-shadcn-date-picker-root id="dp-shadcn-basic">
<proto-ui-shadcn-date-picker-trigger class="w-56">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn-basic');
setElementProps(root, {
defaultMonth: '2026-10',
defaultValue: '2026-10-15',
min: '2026-10-01',
max: '2026-11-30',
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'Pick a date' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>Range Picker
Section titled “Range Picker”Select a date range with mode="range", defaultRange, minNights, maxNights, and unavailable dates.
<div class="flex flex-col items-start gap-2">
<span class="text-sm font-medium">Date Picker Range</span>
<proto-ui-shadcn-date-picker-root id="dp-shadcn-range">
<proto-ui-shadcn-date-picker-trigger class="w-64">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn-range');
setElementProps(root, {
mode: 'range',
defaultMonth: '2026-10',
defaultRange: { from: '2026-10-10', to: '2026-10-16' },
unavailable: ['2026-10-18'],
minNights: 1,
maxNights: 14,
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'Pick a date range' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>Multiple & Disabled
Section titled “Multiple & Disabled”Use mode="multiple" with maxSelected to toggle multiple dates while keeping the popover open, paired with a disabled picker.
<div class="flex flex-col items-start gap-2">
<span class="text-sm font-medium">Multiple Dates</span>
<proto-ui-shadcn-date-picker-root id="dp-shadcn-multiple">
<proto-ui-shadcn-date-picker-trigger class="w-64">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn-multiple');
setElementProps(root, {
mode: 'multiple',
defaultMonth: '2026-10',
defaultValues: ['2026-10-05', '2026-10-12'],
maxSelected: 4,
unavailable: ['2026-10-18', '2026-10-19'],
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'Pick dates' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>Range & Multiple Comparison
Section titled “Range & Multiple Comparison”Compare mode="range" and mode="multiple" side by side under identical availability rules.
<div class="flex flex-col items-start gap-2">
<span class="text-sm font-medium">
Date Range & Multiple Dates
</span>
<proto-ui-shadcn-date-picker-root id="dp-shadcn-selection">
<proto-ui-shadcn-date-picker-trigger class="w-64">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn-selection');
setElementProps(root, {
mode: 'range',
defaultMonth: '2026-10',
defaultRange: { from: '2026-10-10', to: '2026-10-14' },
unavailable: ['2026-10-18'],
minNights: 1,
maxNights: 14,
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'Pick dates' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>RTL & Locale
Section titled “RTL & Locale”Pass direction="rtl" and locale="ar-SA" to mirror grid order and localize headings and weekdays.
<div class="flex flex-col items-start gap-2">
<span class="text-sm font-medium">
تاريخ الموعد (RTL · ar-SA)
</span>
<proto-ui-shadcn-date-picker-root id="dp-shadcn-rtl">
<proto-ui-shadcn-date-picker-trigger class="w-56">
<proto-ui-shadcn-date-picker-value></proto-ui-shadcn-date-picker-value>
<span aria-hidden="true">▾</span>
</proto-ui-shadcn-date-picker-trigger>
<proto-ui-shadcn-date-picker-content>
<proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-previous>
‹
</proto-ui-shadcn-calendar-previous>
<proto-ui-shadcn-calendar-heading></proto-ui-shadcn-calendar-heading>
<proto-ui-shadcn-calendar-next>
›
</proto-ui-shadcn-calendar-next>
</proto-ui-shadcn-calendar-caption>
<proto-ui-shadcn-calendar-grid>
<proto-ui-shadcn-calendar-weekdays></proto-ui-shadcn-calendar-weekdays>
</proto-ui-shadcn-calendar-grid>
</proto-ui-shadcn-date-picker-content>
</proto-ui-shadcn-date-picker-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#dp-shadcn-rtl');
setElementProps(root, {
defaultMonth: '2026-10',
locale: 'ar-SA',
direction: 'rtl',
styleProfile: 'rhea',
});
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-value'),
{ placeholder: 'اختر تاريخًا' }
);
setElementProps(
root.querySelector('proto-ui-shadcn-date-picker-content'),
{ side: 'bottom', align: 'start', sideOffset: 6 }
);
const weekdays = root.querySelector(
'proto-ui-shadcn-calendar-weekdays'
);
for (let offset = 0; offset < 7; offset++) {
const cell = document.createElement(
'proto-ui-shadcn-calendar-weekday'
);
setElementProps(cell, { offset });
weekdays.append(cell);
}
const grid = root.querySelector('proto-ui-shadcn-calendar-grid');
for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
const row = document.createElement(
'proto-ui-shadcn-calendar-row'
);
setElementProps(row, { index: rowIndex });
for (let col = 0; col < 7; col++) {
const day = document.createElement(
'proto-ui-shadcn-date-picker-day'
);
setElementProps(day, { offset: rowIndex * 7 + col });
row.append(day);
}
grid.append(row);
}
</script>Date Picker consists of DatePickerRoot, DatePickerTrigger, DatePickerValue, DatePickerContent, and DatePickerDay, reusing Calendar caption, navigation, and grid parts inside the popup.
| Prop | Type | Default |
|---|---|---|
mode | 'single' 'multiple' 'range' | 'single' |
open / defaultOpen | boolean | false |
value / defaultValue | string (YYYY-MM-DD) | '' |
values / defaultValues | readonly string[] | [] |
range / defaultRange | { from?: string; to?: string } | {} |
month / defaultMonth | string (YYYY-MM) | current month |
min / max | string (YYYY-MM-DD) | — |
unavailable | readonly string[] | [] |
minSelected / maxSelected | number | — |
minNights / maxNights | number | — |
locale | string | 'en-US' |
direction | 'ltr' 'rtl' | 'ltr' |
disabled / readOnly | boolean | false |
side / align / sideOffset | PopoverContentProps | 'bottom' / 'center' / 4 |
placeholder (Value) | string | 'Pick a date' |
styleProfile | 'vega' 'nova' 'maia' 'lyra' 'mira' 'luma' 'sera' 'rhea' 'new-york-v4' | 'nova' |