Date Picker

<DatePicker>TailwindCSS Modules

Choose dates, reporting periods, and times with a consistent family of calendar controls. Single dates, multiple selections, ranges, and time inputs share form labels, validation, clear actions, and three standard control heights.

InstallationColoxo CLI
npx coloxo add date-picker --style coloxo-css
ES Module ImportPlayground / npm package
import { DatePicker, RangePicker, TimePicker } from '@coloxo/ui';

Design Tokens:

--cx-brand-600: #2348FF--cx-color-bg-primary--cx-radius-md--cx-shadow-lg36 / 40 / 44px controls

1. Variant Matrix

Explore the picker family in empty, selected, invalid, and disabled states. Open an enabled field to interact with its calendar or time panel.

VariantDefaultSelectedInvalidDisabled
date
date + time
range
time

2. Control heights

Picker triggers match Input and Select at 36px, 40px, and 44px. Calendar and time panels keep the same density at every trigger size.

Sizes

size="sm"
Height: 36px

Compact filters and dense toolbars

size="md"DEFAULT
Height: 40px

Standard forms and scheduling

size="lg"
Height: 44px

Prominent forms and touch targets

3. Selection modes & constraints

Select a day, week, month, quarter, or year. Use multiple selection for separate dates and ranges for a continuous period.

Calendar modes

Date bounds & time steps

Weekdays in October 2026 only.

Confirm each date and time with OK.

12-hour clock with 15-minute steps.

4. Interactive Props Configurator

Visual Render CanvasDATEPICKER | SIZE: MD

No selection

tsx
<DatePicker  label="Scheduled date"  size="md"  value={date}  onChange={setDate}/>

5. Dark theme

Date, range, and time fields use shared surface, border, and text tokens for dark forms. Popup panels follow the page theme.

DatePicker
RangePicker
TimePicker

6. Enterprise layout compositions

Combine date and time controls with clear labels and supporting details in scheduling and reporting workflows.

Schedule a deployment

Choose a maintenance window for production.

Select the date for this release.

Export financial report

Set a reporting period before exporting.

Optional quarter for comparison.

Accessibility

Keyboard access

Focus the trigger and use Enter or Space to open the panel. Calendar days support arrow-key navigation; Escape dismisses the popup.

Labels & validation

Use label for a visible field name. Description and error text are linked to the trigger, and invalid fields expose aria-invalid.

Selection feedback

Selected dates appear in the trigger. Disabled dates cannot be selected, and date-time selections are committed with the panel's OK action.

Props

NameTypeDefaultDescription
size"sm" | "md" | "lg"mdTrigger height/typography; matches Input and Select. Popup density is fixed.
picker"date" | "week" | "month" | "quarter" | "year"datePanel granularity for DatePicker.
showTimeboolean | ShowTimeOptions—Date-time mode; commits on OK.
multipleboolean—Multi-date selection (Date[]).
value / defaultValueDate | Date[] | DateRangeValue—Controlled or initial selection. DatePicker uses Date, multiple uses Date[], RangePicker uses { from, to }, and TimePicker uses Date.
onChange(value) => void—Receives the selected value for the picker type, or its empty value when cleared.
label / description / errorReactNode—Visible field label, supporting text, and validation message.
disabled / requiredboolean—Disable the field or display its required indicator.
open / defaultOpenboolean—Control the popup or set its initial open state.
onOpenChange(open: boolean) => void—Called when the popup opens or closes.
minuteStep / hourStep / secondStepnumber—TimePicker: interval between options in the time columns. Also available inside showTime options.
use12Hoursboolean—TimePicker: use a 12-hour clock with AM/PM. Also available inside showTime options.
allowClearbooleantrueShow clear control on the trigger.
formatstring—Display format (date-fns tokens).
minDateDate—Earliest selectable date.
maxDateDate—Latest selectable date.
disabledDatesDate[] | ((date: Date) => boolean)—Blocked dates.