API reference: @salmonui/calendars/date-field
TimeFieldcomponent
import { TimeField } from '@salmonui/calendars/date-field';Also exported from @salmonui/calendars/time-picker.
function TimeField(props: TimeFieldProps): import("react").JSX.Element;
A segmented time input: one spinbutton per segment, in the locale's order and hour cycle.
Props: TimeFieldProps
| Name | Signature | Description |
|---|---|---|
granularityoptional | readonly granularity?: 'hour' | 'minute' | 'second'; | Deepest segment. Default |
valueoptional | readonly value?: TimeInput | null; | |
defaultValueoptional | readonly defaultValue?: TimeInput | null; | |
onValueChangeoptional | readonly onValueChange?: (value: PlainTime | null, details: FieldChangeDetails) => void; | |
minoptional | readonly min?: TimeInput; | |
maxoptional | readonly max?: TimeInput; | |
placeholderValueoptional | readonly placeholderValue?: TimeInput; | Seeds Up / Down on empty segments (default: now, read in the event handler). |
isTimeDisabledoptional | readonly isTimeDisabled?: (time: PlainTime) => boolean; | Rejects single times (the field becomes invalid). |
refoptionalinherited | ref?: Ref<HTMLDivElement>; | |
sizeoptionalinherited | size?: "lg" | "md" | "sm"; | Control size: |
labeloptionalinherited | label?: ReactNode; | Visible label above the segments; also names the group. |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ReactNode; | Shown when |
formatoptionalinherited | format?: DateFormat; | Display format: |
hourCycleoptionalinherited | hourCycle?: HourCycle; |
|
localeoptionalinherited | locale?: string; | BCP 47 locale. Default |
timeZoneoptionalinherited | timeZone?: string; | IANA zone for |
inputFormatsoptionalinherited | inputFormats?: readonly string[]; | Extra accepted paste and typed formats (patterns); ISO is always accepted. |
parseoptionalinherited | parse?: ParseFn; | Custom text parser, tried last. |
strictoptionalinherited | strict?: boolean; |
|
disabledoptionalinherited | disabled?: boolean; | |
readOnlyoptionalinherited | readOnly?: boolean; | |
requiredoptionalinherited | required?: boolean; | |
invalidoptionalinherited | invalid?: boolean; | |
autoFocusoptionalinherited | autoFocus?: boolean; | |
nameoptionalinherited | name?: string; | Form field name: a visually hidden input posts the ISO value. |
formoptionalinherited | form?: string; | |
onFocusoptionalinherited | onFocus?: ((event: FocusEvent<HTMLDivElement, Element>) => void); | Fires once when focus enters the group. |
onBluroptionalinherited | onBlur?: ((event: FocusEvent<HTMLDivElement, Element>) => void); | Fires once when focus leaves the group. |
localeTextoptionalinherited | localeText?: Partial<FieldLocaleText>; | |
diroptionalinherited | dir?: "ltr" | "rtl"; | Direction override; inherited from the document by default. |