API reference: @salmonui/calendars/date-picker
DatePickerPropsinterface
import type { DatePickerProps } from '@salmonui/calendars/date-picker';interface DatePickerProps extends PickerFieldProps, DatePickerCalendarProps {
readonly value?: DateInput | null | undefined;
readonly defaultValue?: DateInput | null | undefined;
readonly onValueChange?: ((value: PlainDate | PlainDateTime | null, details: DatePickerValueChangeDetails) => void) | undefined;
readonly granularity?: DatePickerGranularity | undefined;
readonly min?: DateInput | null | undefined;
readonly max?: DateInput | null | undefined;
readonly format?: DateFormat | undefined;
readonly inputFormats?: readonly string[] | undefined;
readonly parse?: ParseFn | undefined;
readonly placeholderValue?: DateInput | null | undefined;
readonly timeStep?: number | undefined;
readonly minTime?: TimeInput | null | undefined;
readonly maxTime?: TimeInput | null | undefined;
readonly localeText?: Partial<DatePickerLocaleText> | undefined;
readonly ref?: Ref<PickerHandle> | undefined;
}
| Name | Signature | Description |
|---|---|---|
readOnlyoptionalinherited | readOnly?: boolean; | |
valueoptional | readonly value?: DateInput | null | undefined; | A |
defaultValueoptional | readonly defaultValue?: DateInput | null | undefined; | |
onValueChangeoptional | readonly onValueChange?: ((value: PlainDate | PlainDateTime | null, details: DatePickerValueChangeDetails) => void) | undefined; |
|
granularityoptional | readonly granularity?: DatePickerGranularity | undefined; | Deepest segment; also the deepest calendar view and the time part. Default |
minoptional | readonly min?: DateInput | null | undefined; | |
maxoptional | readonly max?: DateInput | null | undefined; | |
formatoptional | readonly format?: DateFormat | undefined; | Display format of the field: |
inputFormatsoptional | readonly inputFormats?: readonly string[] | undefined; | Extra patterns accepted when typing over or pasting a whole value. |
parseoptional | readonly parse?: ParseFn | undefined; | Custom text parser for paste. |
placeholderValueoptional | readonly placeholderValue?: DateInput | null | undefined; | Segment seed and popup position without a value. |
timeStepoptional | readonly timeStep?: number | undefined; | Minutes between time list options (default 30). |
minTimeoptional | readonly minTime?: TimeInput | null | undefined; | Daily time window. |
maxTimeoptional | readonly maxTime?: TimeInput | null | undefined; | |
localeTextoptional | readonly localeText?: Partial<DatePickerLocaleText> | undefined; | |
refoptional | readonly ref?: Ref<PickerHandle> | undefined; | |
firstDayOfWeekoptionalinherited | firstDayOfWeek?: number; | |
showWeekNumbersoptionalinherited | showWeekNumbers?: boolean; | |
weekRuleoptionalinherited | weekRule?: WeekRule; | |
weekdayFormatoptionalinherited | weekdayFormat?: WeekdayFormat; | |
calendaroptionalinherited | calendar?: string; |
|
showTodayButtonoptionalinherited | showTodayButton?: boolean; | |
showOutsideDaysoptionalinherited | showOutsideDays?: boolean; | |
isDateDisabledoptionalinherited | isDateDisabled?: ((date: PlainDate) => boolean); | |
renderDayoptionalinherited | renderDay?: ((ctx: CalendarDayContext) => ReactNode); | |
getDayPropsoptionalinherited | getDayProps?: ((ctx: CalendarDayContext) => CalendarDayProps | undefined); | |
viewoptionalinherited | view?: CalendarView; | |
defaultViewoptionalinherited | defaultView?: CalendarView; | |
onViewChangeoptionalinherited | onViewChange?: ((view: CalendarView) => void); | |
focusedValueoptionalinherited | focusedValue?: DateInput; | |
defaultFocusedValueoptionalinherited | defaultFocusedValue?: DateInput; | |
onFocusedValueChangeoptionalinherited | onFocusedValueChange?: ((date: PlainDate) => void); | |
openoptionalinherited | open?: boolean; | |
defaultOpenoptionalinherited | defaultOpen?: boolean; | |
onOpenChangeoptionalinherited | onOpenChange?: ((open: boolean, details: PickerOpenChangeDetails) => void); | |
popupModeoptionalinherited | popupMode?: PopupMode; | |
disabledoptionalinherited | disabled?: boolean; | |
openOnFocusoptionalinherited | openOnFocus?: boolean; | Opens the popup when focus enters the field. |
editableoptionalinherited | editable?: boolean; |
|
clearableoptionalinherited | clearable?: boolean; | Renders a clear button. |
onClearoptionalinherited | onClear?: (() => void); | |
strictoptionalinherited | strict?: boolean; | Out-of-range values move to the nearest bound and disabled or unparsable input reverts on blur. |
requiredoptionalinherited | required?: boolean; | |
invalidoptionalinherited | invalid?: boolean; | |
labeloptionalinherited | label?: ReactNode; | |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ReactNode; | |
placeholderoptionalinherited | placeholder?: string; | Watermark shown while empty and not focused. |
nameoptionalinherited | name?: string; | |
formoptionalinherited | form?: string; | |
autoFocusoptionalinherited | autoFocus?: boolean; | |
onFocusoptionalinherited | onFocus?: ((event: FocusEvent<Element, Element>) => void); | Focus entered the field group (once). |
onBluroptionalinherited | onBlur?: ((event: FocusEvent<Element, Element>) => void); | Focus left the field group and its popup (once). |
onInvalidoptionalinherited | onInvalid?: (() => void); | The form value input failed constraint validation. |
localeoptionalinherited | locale?: string; | BCP 47 locale; default |
timeZoneoptionalinherited | timeZone?: string; | IANA time zone for instant values ( |
hourCycleoptionalinherited | hourCycle?: "h12" | "h23"; | |
sizeoptionalinherited | size?: "lg" | "md" | "sm"; | Control size: |
idoptionalinherited | id?: string; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
aria-labeloptionalinherited | aria-label?: string; | |
aria-labelledbyoptionalinherited | aria-labelledby?: string; | |
aria-describedbyoptionalinherited | aria-describedby?: string; |