Skip to components
DEVELOPER REFERENCE · v4.0.0

DurationField API

Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.

DurationField23 props4 callbacks0 methods

Props23

DurationField props
NameTypeDescription
valueRequired
string | number | ParsedDuration | nullInspect type
Value to display or edit. The declared type identifies the supported representation; change callbacks describe how edited values are emitted.
labelOptionalstring | undefinedLabel content or accessible name for the component, as rendered by this control.
invalidTextOptionalstring | undefinedValidation message shown when the duration cannot be parsed or accepted.
disabledOptionalboolean | undefinedDisables user interaction with the control.
readOnlyOptionalboolean | undefinedDisplays the current value while preventing user edits.
classNameOptionalstring | undefinedAdditional CSS classes applied to the component root.
sliderOptional
boolean | DurationSliderOptions | undefinedInspect type
Slider configuration or visibility, according to the declared type.
unitButtonsOptionalboolean | undefinedShows the controls for selecting a duration unit.
unitLabelsOptional
Partial<Record<DurationUnit, string>> | undefinedInspect type
Overrides localized labels for duration units.
unitLabelOptionalstring | undefinedAccessible label for the duration-unit control.
placeholderOptionalstring | undefinedOverride the input hint, independently of the configured default unit.
modeLabelOptionalstring | undefinedAccessible label for the duration mode control.
workingLabelOptionalstring | undefinedLabel for working-time duration mode.
elapsedLabelOptionalstring | undefinedLabel for elapsed-time duration mode.
defaultUnitRequired
DurationUnitInspect type
Unit assumed when a duration value does not specify one.
allowedUnitsOptional
readonly DurationUnit[] | undefinedInspect type
Duration units offered by the editor.
allowElapsedOptionalboolean | undefinedAllows elapsed-time duration values in addition to working-time values.
requiredOptionalboolean | undefinedRequires a non-empty value or selection before the edit can be accepted.
minOptionalnumber | undefinedNumeric bounds apply to the authored value, without implicit calendar conversions.
maxOptionalnumber | undefinedMaximum permitted value or upper bound for the control.
maximumFractionDigitsOptionalnumber | undefinedMaximum number of fractional digits used when formatting a duration.
autoApplyOptionalboolean | undefinedApply completed edits automatically. Set false to require explicit Apply.
showActionsOptionalboolean | undefinedShow Apply/Cancel buttons. Defaults to true only when autoApply is false.

Events and callbacks4

DurationField events and callbacks
NameTypeDescription
onChangeRequired
(value: ParsedDuration | null) => voidInspect type
Receives the new value when the user changes the control. Update the corresponding value prop for controlled use.
onCommitOptional
((value: ParsedDuration | null) => void) | undefinedInspect type
A completed slider or unit/mode interaction, distinct from text entry.
onValidityChangeOptional
((valid: boolean) => void) | undefinedInspect type
Receives true or false when the validity of the current input changes.
onDraftChangeOptional
((text: string) => void) | undefinedInspect type
Product forms can keep raw invalid drafts for their existing error/commit pipeline.

Methods0

No component-specific imperative methods. Use props and callbacks to control this component.