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 checkbox allows the user to toggle between 2 or 3 (indeterminate) choices.
import { Checkbox, CheckboxGroup } from "@sharegate/orbit-ui";
A default checkbox.
A checkbox can be rendered without a label.
A checkbox can be checked.
A checkbox can be indeterminate.
A checkbox can be disabled.
A checkbox can have icons after his label.
A checkbox can have a counter after his label.
A checkbox can vary in size.
A checkbox checkmark can be to the left or to the right of his label.
A checkbox 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 if the user has checked the checkbox.
A checkbox can handle checked
state in controlled mode.
Related checkboxes can be group together.
A checkbox group can render his elements vertically.
A checkbox group elements can be reversed.
A checkbox group 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 if the user has checked all the checkbox.
Any component implementing the CheckableContext
can behave like a checkbox group. This is usually done by using the useCheckableProps
hook.
A checkbox group can handle value
state in controlled mode.
import { Checkbox } from "@sharegate/orbit-ui";
"label", "icon", "counter"
Name | Description | Default | ||||
---|---|---|---|---|---|---|
autoFocus | Whether or not the input should autoFocus on render. numberfalsetrue | - | ||||
checked | A controlled checked state value. falsetrue | - | ||||
defaultChecked | The initial value of checked when uncontrolled.falsetrue | - | ||||
defaultIndeterminate | The initial value of indeterminate .falsetrue | - | ||||
indeterminate | A controlled indeterminate state value. falsetrue | - | ||||
onChange | Called when the checkbox checked state change. ChangeEventHandler<Element>
| - | ||||
onValueChange | Called when the checkbox checked state change. (event: ChangeEvent<HTMLInputElement>, isChecked: boolean) => void
| - | ||||
required | Whether or not a user input is required before form submission. falsetrue | - | ||||
reverse | Invert the order the checkmark box and the label. falsetrue | - | ||||
size | A checkbox can vary in size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - | ||||
validationState | Whether or not the input should display as "valid" or "invalid". "valid""invalid" | - | ||||
value | The value to associate with when in a group. string | - |
import { CheckboxGroup } from "@sharegate/orbit-ui";
Name | Description | Default | ||||
---|---|---|---|---|---|---|
align | The alignment of the elements. "center" | "end" | "start" | ResponsiveValue<FlexAlignment> | - | ||||
autoFocus | Whether or not the first input of the group should autoFocus on render. numberfalsetrue | - | ||||
disabled | Whether or not the inputs of the group are disabled. falsetrue | - | ||||
fluid | Whether the elements take up the width & height of their container. false | true | ResponsiveValue<boolean> | - | ||||
inline | Whether or not the element generate line breaks before or after himself. falsetrue | - | ||||
onChange | Called when an input of the group change. (event: SyntheticEvent<Element, Event>, value: string[]) => void
| - | ||||
orientation | The orientation of the elements. "horizontal" | "vertical" | ResponsiveValue<FlexOrientation> | - | ||||
required | Whether a user input is required before form submission. falsetrue | - | ||||
reverse | Whether or not to reverse the order of the elements. falsetrue | - | ||||
size | The checkbox of a group can vary in size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - | ||||
validationState | Whether the group should display as "valid" or "invalid". "valid""invalid" | - | ||||
value | The value of the group. string[] | - | ||||
wrap | Whether elements are forced onto one line or can wrap onto multiple rows. false | true | ResponsiveValue<boolean> | - |