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 button indicates a possible user action.
import { Button, IconButton, ToggleButton, ToggleIconButton, ButtonGroup, ButtonAsLink } from "@sharegate/orbit-ui";
A default button.
A button can contain icons.
Non standard end icons can be provided to handle special cases. However, think twice before adding end icons, start icons should be your go to.
A button can contain a counter.
A button can vary in size.
A button can be disabled.
A button can show a loading indicator. The button text is hidden but the button maintains the width that it would have if the text were visible.
A button can be expanded to full width to fill its parent container.
A button can use different variants.
Used to indicate the main action of a page or a section. This is usually the action we want the user to take.
In a button group, there can be only 1 primary button. This will be reserved for the suggested action.
Secondary buttons are used for user actions that need less prominence in the page or the section. It’s also the button used when there are no suggested actions to the user.
Tertiary buttons are used for actions that need to be there but that we don't want to encourage. A common use case would be a Cancel button in a message or an alert.
Negative buttons are used for actions that would result in a deletion or another non recoverable negative action. These are mostly useful in modals.
A button can be rendered as a link by using the ButtonAsLink
component.
The content of a button can be a single icon. An accessible name must be provided through aria-label prop. See also WCAG practices.
An icon button can be rendered as a link by using the IconButtonAsLink component.
Buttons whose actions are related to each other can be grouped together.
A button group can render his items vertically.
A button group can change the alignment of his items.
Offer a similar experience as a checkbox or radio with the appearance of a button.
A toggle button content can be a single icon. An accessible name must be provided through aria-label
prop. See WCAG practices.
Related toggle buttons can be group together in a group, a checkbox group or a radio group:
A toggle button can handle checked
state in controlled mode.
import { Button } from "@sharegate/orbit-ui";
"icon", "text", "end-icon", "counter"
Name | Description | Default |
---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - |
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - |
inherit | Whether or not the button should inherit it's parent style. falsetrue | - |
loading | A button can show a loading indicator. falsetrue | - |
size | A button can vary in size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - |
variant | The button style to use. "negative""primary""secondary""tertiary" | - |
import { IconButton } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - |
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - |
inherit | Whether or not the button should inherit it's parent style. falsetrue | - |
loading | A button can show a loading indicator. falsetrue | - |
size | A button can vary in size. "xs" | "sm" | "md" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "2xs"> | - |
variant | The button style to use. "negative""primary""secondary""tertiary" | - |
import { ToggleButton } from "@sharegate/orbit-ui";
"icon", "text", "end-icon"
Name | Description | Default | ||||
---|---|---|---|---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - | ||||
checked | A controlled checked value. falsetrue | - | ||||
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - | ||||
defaultChecked | The initial value of checked when uncontrolled.falsetrue | - | ||||
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - | ||||
inherit | Whether or not the button should inherit it's parent style. falsetrue | - | ||||
loading | A button can show a loading indicator. falsetrue | - | ||||
onChange | Called when the button checked state change. (event: SyntheticEvent<Element, Event>, isChecked: boolean) => void
| - | ||||
size | A button can vary in size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - | ||||
value | The value to associate with when in a group. string | - | ||||
variant | The button variant to use. ToggleButtonVariant | - |
import { ToggleIconButton } from "@sharegate/orbit-ui";
Name | Description | Default | ||||
---|---|---|---|---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - | ||||
checked | A controlled checked value. falsetrue | - | ||||
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - | ||||
defaultChecked | The initial value of checked when uncontrolled.falsetrue | - | ||||
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - | ||||
inherit | Whether or not the button should inherit it's parent style. falsetrue | - | ||||
loading | A button can show a loading indicator. falsetrue | - | ||||
onChange | Called when the button checked state change. (event: SyntheticEvent<Element, Event>, isChecked: boolean) => void
| - | ||||
size | A button can vary in size. "xs" | "sm" | "md" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "2xs"> | - | ||||
value | The value to associate with when in a group. string | - | ||||
variant | The style to use. ToggleButtonVariant | - |
import { ButtonGroup } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
align | The alignment of the elements. "center" | "end" | "start" | ResponsiveValue<FlexAlignment> | - |
disabled | Whether or not the buttons 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 | - |
orientation | The orientation of the elements. "horizontal" | "vertical" | ResponsiveValue<FlexOrientation> | - |
reverse | Whether or not to reverse the order of the elements. falsetrue | - |
size | The buttons size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - |
wrap | Whether elements are forced onto one line or can wrap onto multiple rows. false | true | ResponsiveValue<boolean> | - |
import { ButtonAsLink } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - |
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - |
inherit | Whether or not the button should inherit it's parent style. falsetrue | - |
loading | A button can show a loading indicator. falsetrue | - |
size | A button can vary in size. "sm" | "md" | ResponsiveValue<"sm" | "md"> | - |
variant | The button style to use. "negative""primary""secondary""tertiary" | - |
import { IconButtonAsLink } from "@sharegate/orbit-ui";
Name | Description | Default |
---|---|---|
autoFocus | Whether or not the button should autoFocus on render. numberfalsetrue | - |
children* | React children. string | number | false | true | ReactElement<any, string | JSXElementConstructor<any>> | ReactFragment | ReactPortal | - |
fluid | Whether or not the button take up the width of its container. false | true | ResponsiveValue<boolean> | - |
inherit | Whether or not the button should inherit it's parent style. falsetrue | - |
loading | A button can show a loading indicator. falsetrue | - |
size | A button can vary in size. "xs" | "sm" | "md" | "2xs" | ResponsiveValue<"xs" | "sm" | "md" | "2xs"> | - |
variant | The button style to use. "negative""primary""secondary""tertiary" | - |