DatePicker

Custom date picker with month, year and decade views. Fully keyboard-accessible with smart dropdown positioning, no native input dependency.

Playground
label
placeholder
format
size
clearable
showIcon
disabled
rounded
<DatePicker
  placeholder="Select date"
/>

Basic

Uncontrolled usage, manages state internally.

Clearable

Adds a clear button when a date is selected.

Controlled

Drive the value from external state.

No date selected

With Label and Hint

Start datePick your event start date

Error State

AppointmentPlease select a date

Min / Max Date

Restrict selection to a date range (±30 days from today).

Within 30 days

Disable Weekends

Pass a disabledDate function to block specific dates.

Weekdays only

Custom Format

Use format tokens: YYYY, MM, DD.

Sizes

Disabled

Locale: Tiếng Việt

Pass locale="vi" to switch all panel labels to Vietnamese. When omitted, the picker auto-detects from <html lang="…">.

Locale: Custom object

Pass a full DatePickerLocale object for any language not built-in.

Hide Icon

Set showIcon={false} to remove the calendar icon from the trigger.

Custom Icon

Pass any ReactNode via the icon prop to replace the default calendar icon.

API

PropertyTypeDefaultDescription
valueDate | nullControlled date value
defaultValueDate | nullInitial value for uncontrolled usage
onChange(date: Date | null) => voidCalled when the date changes. Receives null when cleared
placeholderstring"Select date"Placeholder shown when no date is selected
formatstring"MM/DD/YYYY"Display format. Tokens: YYYY, MM, DD
disabledbooleanfalseDisable the picker
clearablebooleanfalseShow a clear button when a date is selected
size"sm" | "md" | "lg""md"Size preset
minDateDateEarliest selectable date
maxDateDateLatest selectable date
disabledDate(date: Date) => booleanCustom function to disable specific dates
labelstringLabel rendered above the trigger
requiredbooleanfalseMark label as required
errorstringError message shown below the picker
hintstringHint text shown below the picker
showIconbooleantrueShow or hide the calendar icon in the trigger
iconReactNodeReplace the default calendar icon with a custom element
localestring | DatePickerLocaleautoLanguage for month names, weekdays and Today button. Pass a BCP-47 tag ("vi", "en") or a custom locale object. Auto-detects from <html lang="…"> when omitted.
rounded"none" | "sm" | "md" | "lg" | "full"Border-radius preset
classNamestringAdditional class on the root element