Date picker
Standalone themeable date and time picker with portal popup calendar, editable text draft input, and customizable token styling.
// Radix — @radix-ui/react-popover
import { DatePicker } from "@shavin/ui";Date and time
Component Source
<DatePicker value={date} onChange={setDate} />Date only
Component Source
<DatePicker value={date} onChange={setDate} dateOnly />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value* | Date | — | Active selected Date object. |
| onChange* | (d: Date) => void | — | Callback fired when Date changes. |
| dateOnly | boolean | false | Hide time selection controls and close on day pick. Default false. |
| tokens | Partial<DatePickerTokens> | — | Override any visual token; unspecified keys fall back to the theme. |
| className | string | — | Optional custom CSS class name. |
| id | string | — | id of the text field, so a `<label htmlFor>` can name it. |
| locale | string | — | Locale for the field text and day names. Defaults to the browser's locale. |
* required