Zephora UI

Form

DatePicker

Read-only date input that opens a month-view Calendar in a portal popover. The Calendar is also exported for inline use, with full keyboard grid navigation.

Import

import { DatePicker, Calendar } from "@zephora/react";

Examples

Basic

Controlled with min/max

Days outside minDate/maxDate are disabled in the calendar.

Selected: none

Inline Calendar

Use the exported Calendar directly, without the popover.

SunMonTueWedThuFriSat

Locale

Month and weekday names follow the BCP 47 `locale`.

Range

`mode="range"` selects a `[start, end]` pair; `allowClear` adds a clear button and `presets` render quick-pick buttons under the calendar.

With time

`showTime` renders hour/minute selects under the day grid and includes the time in the display; `minuteStep` sets the minute granularity. `disabledDate` blocks individual days (weekends here) and `firstDayOfWeek` starts the week on Monday.

API

DatePicker props

PropTypeDefaultDescription
valueDate | nullControlled selected date (single mode).
defaultValueDate | nullInitial selected date in uncontrolled mode (single mode).
onValueChange(date: Date | null) => voidCalled with the newly selected date (single mode).
mode"single" | "range""single"Selection mode.
rangeValueDateRangeControlled selected range (range mode) — [start, end], either side may be null while in progress.
defaultRangeValueDateRangeInitial range in uncontrolled mode (range mode).
onRangeChange(range: DateRange) => voidCalled whenever the range changes (range mode).
minDateDateEarliest selectable day (inclusive).
maxDateDateLatest selectable day (inclusive).
disabledDate(date: Date) => booleanDisables individual days beyond minDate/maxDate.
firstDayOfWeeknumberfrom localeFirst day of the week: 0 = Sunday, 1 = Monday…
showTimebooleanfalseRenders hour/minute selects and includes the time in the display.
minuteStepnumber5Minute select granularity when showTime is set.
presetsCalendarPreset[]Quick-pick buttons shown under the calendar: { label, value } with a Date or a [start, end] tuple.
allowClearbooleanfalseRenders a clear button inside the trigger when a value is set.
format(date: Date) => stringOverrides the display formatting of dates in the trigger.
localestring"en"BCP 47 locale used for formatting.
placeholderstring"Select date…"Text shown when no date is selected.
size"sm" | "md" | "lg""md"Input scale.
invalidbooleanfalseMarks the input invalid (aria-invalid).
disabledbooleanfalseDisables the input.
aria-label / aria-labelledbystringAccessible name for the input.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restHTMLAttributes<HTMLDivElement>Forwarded to the root wrapper element.

Calendar props

PropTypeDefaultDescription
valueDate | nullControlled selected date (single mode).
defaultValueDate | nullInitial selected date in uncontrolled mode (single mode).
onValueChange(date: Date | null) => voidCalled with the newly selected date (single mode).
mode"single" | "range""single"Selection mode.
rangeValue / defaultRangeValue / onRangeChangeDateRange / (range: DateRange) => voidRange-mode value, initial value and change callback.
minDateDateEarliest selectable day (inclusive).
maxDateDateLatest selectable day (inclusive).
disabledDate(date: Date) => booleanDisables individual days beyond minDate/maxDate.
firstDayOfWeeknumberfrom localeFirst day of the week: 0 = Sunday, 1 = Monday…
showTime / minuteStepboolean / numberfalse / 5Renders hour/minute selects under the day grid.
presetsCalendarPreset[]Quick-pick buttons shown under the calendar.
localestring"en"BCP 47 locale for month/weekday names.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restHTMLAttributes<HTMLDivElement>Forwarded to the calendar wrapper element.

Keyboard

KeyAction
Enter / Space / Arrow Down (input)Opens the calendar popover.
EscapeCloses the popover and returns focus to the input.
Arrow keys (grid)Move focus by one day (left/right) or one week (up/down).
Home / End (grid)Moves to the start / end of the week.
Page Up / Page Down (grid)Moves to the previous / next month.
Enter / Space (grid)Selects the focused day.