No Preview

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.

NumberInput

A number input is used to let the user enter a numeric value.

usage
import { NumberInput } from "@sharegate/orbit-ui";
sources
Github

Usage

Default

A default number input.

Editable example

Value

A number input can have a value.

Editable example

Min / Max

A number input value can be forced between min & max boundaries.

Editable example

Icon

A number input can have an icon.

Editable example

Disabled

A number input can be disabled.

Editable example

Readonly

A number input can be readonly.

Editable example

Loading

A number input can show that it is currently loading data.

Editable example

Fluid

A number input can take the width of its container.

Editable example

Validation

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.

Editable example

Controlled

A number input value can be handled in controlled mode.

Editable example

API

NumberInput

usage
import { NumberInput } from "@sharegate/orbit-ui";
NameDescriptionDefault
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
eventReact's original event.
valueThe new value.
-
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>>
-