DurationField API
Props, callbacks and methods. Select an underlined type to explore its fields, allowed values and callback arguments.
DurationField23 props4 callbacks0 methods
Props23
| Name | Type | Description |
|---|---|---|
valueRequired |
| Value to display or edit. The declared type identifies the supported representation; change callbacks describe how edited values are emitted. |
labelOptional | string | undefined | Label content or accessible name for the component, as rendered by this control. |
invalidTextOptional | string | undefined | Validation message shown when the duration cannot be parsed or accepted. |
disabledOptional | boolean | undefined | Disables user interaction with the control. |
readOnlyOptional | boolean | undefined | Displays the current value while preventing user edits. |
classNameOptional | string | undefined | Additional CSS classes applied to the component root. |
sliderOptional |
| Slider configuration or visibility, according to the declared type. |
unitButtonsOptional | boolean | undefined | Shows the controls for selecting a duration unit. |
unitLabelsOptional |
| Overrides localized labels for duration units. |
unitLabelOptional | string | undefined | Accessible label for the duration-unit control. |
placeholderOptional | string | undefined | Override the input hint, independently of the configured default unit. |
modeLabelOptional | string | undefined | Accessible label for the duration mode control. |
workingLabelOptional | string | undefined | Label for working-time duration mode. |
elapsedLabelOptional | string | undefined | Label for elapsed-time duration mode. |
defaultUnitRequired |
| Unit assumed when a duration value does not specify one. |
allowedUnitsOptional |
| Duration units offered by the editor. |
allowElapsedOptional | boolean | undefined | Allows elapsed-time duration values in addition to working-time values. |
requiredOptional | boolean | undefined | Requires a non-empty value or selection before the edit can be accepted. |
minOptional | number | undefined | Numeric bounds apply to the authored value, without implicit calendar conversions. |
maxOptional | number | undefined | Maximum permitted value or upper bound for the control. |
maximumFractionDigitsOptional | number | undefined | Maximum number of fractional digits used when formatting a duration. |
autoApplyOptional | boolean | undefined | Apply completed edits automatically. Set false to require explicit Apply. |
showActionsOptional | boolean | undefined | Show Apply/Cancel buttons. Defaults to true only when autoApply is false. |
Events and callbacks4
| Name | Type | Description |
|---|---|---|
onChangeRequired |
| Receives the new value when the user changes the control. Update the corresponding value prop for controlled use. |
onCommitOptional |
| A completed slider or unit/mode interaction, distinct from text entry. |
onValidityChangeOptional |
| Receives true or false when the validity of the current input changes. |
onDraftChangeOptional |
| 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.