Button Group
The ButtonGroup component can be used to group related buttons.
Basic button group
The buttons can be grouped by wrapping them with the ButtonGroup
component. They need to be immediate children.
Preview
Usage
import { Button, ButtonGroup } from 'archi-ui'
<ButtonGroup>
<Button>One</Button>
<Button>Two</Button>
<Button>Three</Button>
</ButtonGroup>
Variant
All the standard button variants are supported
Preview
Sizes
The size
props can be used to control the appearance of the button group.
Preview
Color
Use color
prop to control the appearance of the button group.
Preview
Split Button
ButtonGroup
can also be used to create a split button. The dropdown can change the button action (as in this example) or be used to immediately trigger a related action.
Preview
Loading
Use the loading
prop from Button
to set buttons in a loading state and disable interactions.
Preview
Button Group Orientation
The button group can be displayed vertically using the orientation
prop
Preview
ButtonGroup API
API reference docs for the React ButtonGroup component.
Props
Name | Type | Default | Description |
---|---|---|---|
children | node | - | The content of the component. |
className | string | - | Override or extend the styles applied to the component. |
variant | 'filled' | 'outlined' | 'ghost' | 'link' | 'outlined' | The variant to use. |
size | 'sm' | 'md' | 'lg' | 'md' | The size of the component. |
color | 'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error' | 'primary' | The color of the component. |
disabled | bool | false | If true , the component is disabled. |
fullwidth | bool | false | If true , the button will take up the full width of its container. |
orientation | 'horizontal' | 'vertical' | 'horizontal' | The component orientation (layout flow direction). |
Last updated on