DatePicker
Pairs a Calendar inside a Popover with a button that reads back the chosen date. Use it wherever a date needs picking rather than typing.
React
Ready
Figma
Import
import { DatePicker } from "@kela-systems/ui-components";This page has no live example yet. Storybook shows DatePicker in every state and theme.
Props
DatePicker
| Name | Default | Description |
|---|---|---|
variant"default" | "secondary" | "destructive" | "outline" | "ghost" | "link" | "default" | |
size"default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "default" | |
captionLayout"label" | "dropdown" | "dropdown-months" | "dropdown-years" | "label" | |
loadingboolean | Shows a spinner and prevents interaction while keeping the variant's resting colors. | |
valueDate | ||
defaultValueDate | ||
onValueChange(date: Date | undefined) => void | ||
placeholderstring | Select date | |
localeReact.ComponentProps<typeof Calendar>["locale"] | ||
formatValue(date: Date | undefined) => string | undefined | (date) => formatDate(date, locale?.code) | Renders the trigger's label. Defaults to a long date in locale, or the user's locale without one. |
It also takes the props of Base UI's button.