Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
A number input is used to let the user enter a numeric value.
import { NumberInput } from "@sharegate/orbit-ui";
A default number input.
A number input can have a value.
A number input value can be forced between min & max boundaries.
A number input can have an icon.
A number input can be disabled.
A number input can be readonly.
A number input can show that it is currently loading data.
A number input can take the width of its container.
A number input can display a validation state to communicate to the user whether the current value is valid or invalid. Implement your own validation logic in your app and pass either "valid"
or "invalid"
to the input via the validationState
prop.
The example below illustrates how one would validate a required age value.
A number input value
can be handled in controlled mode.
import { NumberInput } from "@sharegate/orbit-ui";
Name | Description | Default | ||||
---|---|---|---|---|---|---|
autoFocus | Whether or not the input should autoFocus on render. numberfalsetrue | - | ||||
defaultValue | The default value of value when uncontrolled.number | - | ||||
fluid | Whether or not the input take up the width of its container. false | true | ResponsiveValue<boolean> | - | ||||
icon | Icon component rendered before the value. ReactElement<any, string | JSXElementConstructor<any>> | - | ||||
loading | Whether or not to render a loader. falsetrue | - | ||||
max | The maximum value of the input. number | - | ||||
min | The minimum value of the input. number | - | ||||
onValueChange | Called when the input value change. (event: SyntheticEvent<Element, Event>, value: number) => void
| - | ||||
step | The step used to increment or decrement the value. number | - | ||||
validationState | Whether or not the input should display as "valid" or "invalid". "valid""invalid" | - | ||||
value | A controlled value. number | - | ||||
wrapperProps | Additional props to render on the wrapper element. Partial<OmitInternalProps<InnerBoxProps, never> & RefAttributes<any>> | - |