Subcomponents
This component has 3 subcomponents:
Control
The control subcomponent is required to render the Control of the NumberInput component. Because of this, this component extends the native inputcomponent props. Because of this, you can use all of the native props. This is a required children.
Control API
Notice that there is a difference between using hasError, isDisabled, isReadOnly here or in the parent component. It is not recommended to change this props in the Control subcomponent, because this props can be inherited from the Wrapper. If you use it in the Control subcomponent, you will get the state only in the field.
value
string | number | readonly string[] | undefined;
β
defaultValue
string | number | readonly string[] | undefined;
β
hasError
boolean
β
isDisabled
boolean
β
isReadOnly
boolean
β
min
number
β
max
number
β
maxLength
number
β
showButtons
boolean
β
isWholeNumbersOnly
boolean
β
customFilter
(value: string) => string;
β
onChange
(e: React.ChangeEvent<HTMLInputElement>) => void;
β
defaultValue
This sets a default value for the input when the DOM is rendered. Used when having an uncontrolled approach.
maxLength
Property that defines the maximum length of characters the input field can receive. Notice the difference between the max and maxLength is esentially that max is just a visual representation of the maximum.
HelpText
The HelpText subcomponent extends the SDS HelpText component. See for reference: HelpText
Label
The Label subcomponent extends the SDS label component. See for reference: Label
Last updated