DatePicker
Date, month and year picking with native Date values, plus a two-month range picker.
import { DatePicker } from '@lobehub/ui/base-ui';Data Entry
Basic
Loading preview
Range
Loading preview
APIs
DatePicker properties
allowClearPickerCommonPropsbooleanDefaults to
true.classNamePickerCommonPropsstringdefaultValuenull | DateDefaults to
null.disabledPickerCommonPropsbooleandisabledDatePickerCommonProps(date: Date) => booleanfooternull | string | number | bigint | false | true | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<AwaitedReactNode>formatPickerCommonPropsstring | (date: Date) => stringmaxPickerCommonPropsDateminPickerCommonPropsDatemode'date' | 'month' | 'year'Defaults to
"date".onChange(date: Date | null) => voidplaceholderstringshadowPickerCommonPropsbooleansizePickerCommonProps'small' | 'large' | 'middle'stylePickerCommonPropsCSSPropertiesvaluenull | DatevariantPickerCommonProps'filled' | 'outlined' | 'borderless'
DateRangePicker properties
allowClearPickerCommonPropsbooleanDefaults to
true.classNamePickerCommonPropsstringdefaultValueDateRangeValuedisabledPickerCommonPropsbooleandisabledDatePickerCommonProps(date: Date) => booleanformatPickerCommonPropsstring | (date: Date) => stringmaxPickerCommonPropsDateminPickerCommonPropsDateonChange(range: DateRangeValue) => voidplaceholder[string, string]shadowPickerCommonPropsbooleansizePickerCommonProps'small' | 'large' | 'middle'stylePickerCommonPropsCSSPropertiesvalueDateRangeValuevariantPickerCommonProps'filled' | 'outlined' | 'borderless'
Values are native Date objects; days compare by calendar day, so a min with a time of day still enables that day. The grid always shows six weeks and follows the active dayjs locale for week start and names. Click the title to move from days to months to years; mode sets the lowest level.
Migrating from antd DatePicker
Dayjsvalues →Date(dayjs(value).toDate()at the call site).picker="month"→mode="month";minDate/maxDate→min/max.renderExtraFooter→footer;showNow={false}is the default.DatePicker.RangePicker→DateRangePicker.- Time, week, quarter and
presetsare not supported.
Helpful?