amountLabel | LocalizedMessage | — | Accessible name of the amount spinbutton, such as "Amount". |
label | LocalizedMessage | — | Visible label of the whole field. It names the group, and a click on it focuses the amount. |
unitLabel | LocalizedMessage | — | Accessible name of the unit choice, such as "Unit". |
units | DurationUnitOptions | — | The units the user can pick, one to five, each with the label the caller supplies. Two to five render as a
segmented choice; one renders as a suffix on the amount and no choice. More than five is a type error. |
autoFocus | boolean | — | Focuses the amount on mount. |
className | string | — | Classes on the root. Put overrides in @layer chroma.overrides. |
decrementLabel | LocalizedMessage | — | Accessible name of the amount's decrement button. The button is not rendered without it. |
defaultUnit | DurationUnit | — | The unit shown while the value is empty. Defaults to the unit of defaultValue, then to the first of units. |
defaultValue | Duration | null | — | Initial value when uncontrolled. Also what a native form reset restores. |
description | LocalizedMessage | — | Supporting copy below the controls, linked with the group's aria-describedby. |
disabled | boolean | — | Disables every part. |
error | LocalizedMessage | — | Error copy below the controls while {@link invalid} is true. |
form | string | — | Native form of both hidden inputs and of the amount. |
id | string | — | Id of the amount input, which the label points at. Generated when omitted. |
incrementLabel | LocalizedMessage | — | Accessible name of the amount's increment button. The button is not rendered without it. |
invalid | boolean | — | Paints the invalid edge, sets aria-invalid and shows error. |
locale | string | — | BCP 47 locale for the digits of the amount. Defaults to the runtime locale. |
max | DurationLimit | — | Upper bound: a {@link Duration} (overall) or an amount per unit. Unbounded when omitted. |
min | DurationLimit | — | Lower bound: a {@link Duration} (overall) or an amount per unit. The amount never goes below 0. |
name | string | — | Native name: posts the amount (an empty string when empty). |
onBlur | FocusEventHandler<HTMLElement> | — | Called once when focus leaves the whole field for somewhere outside it, such as the next field. It is not called
when focus moves between its parts, so a form library validates on blur once per visit. |
onFocus | FocusEventHandler<HTMLElement> | — | Called once when focus enters the field from outside it. It is not called when focus moves between the amount, its
steppers, the unit and the presets. Use it with onBlur to track whether the field was touched. |
onValueChange | ((value: Duration | null, details: DurationFieldChangeDetails) => void) | — | Called for every value change. details.part says which part changed and details.reason why. Every change is
cancelable except a native form reset. |
placeholder | LocalizedMessage | — | Placeholder of the amount while it is empty. |
presets | DurationPresets | — | No presets.
Shortcuts that set the amount and the unit together. At most five; more is a type error. |
presetsLabel | LocalizedMessage | — | No presets, so nothing to name.
Accessible name of the preset choice, such as "Quick picks". |
readOnly | boolean | — | The amount reads and focuses; the unit and presets keep their selection and ignore changes. |
ref | Ref<HTMLInputElement> | — | Ref to the amount input. |
required | boolean | — | Shows the label's required marker and makes the amount required, natively and for assistive technology. |
requiredHint | LocalizedMessage | — | Form-level explanation of required fields, shown under the label. |
size | InputSize | — | Control scale. Defaults to {@link InputSize.Large}. |
step | number | — | Distance between amounts. Defaults to 1. |
unitName | string | — | Native name of a second hidden input that posts the shown unit. Omit it to post the amount only. |
value | Duration | null | — | Controlled value. null is a controlled empty value; undefined is uncontrolled. |
valueAnnouncement | DurationFieldValueAnnouncementCopy | — | Copy for the live announcement after a stepper press or a limit. Defaults to the formatted amount alone. |