Button Group
Type: React component
How to get ButtonGroup?
JavaScript
import { ButtonGroup } from 'fds/components';
A group of buttons. A buttons presented in a ButtonGroup can be selected, which will cause this button to be selected. Only one of the buttons can be selected at a time.
Keyboard behavior:
-
Enter: call the onItemClick prop of the focused button.
Props
is
Disabled (Optional)
Type: Boolean
Whether or not the component should be rendered in a disabled state.
Default value
is
Full Width (Optional)
Type: Boolean
Whether or not the component grows to the full available width.
Default value
items
(Required)
Type: Object
An item with a property with a string value to display and a property to hold the actual value.
Properties
on
Item Click (Required)
Type: Function
A callback that is called whenever a rendered item is clicked and is not in a disabled state.
Arguments
selected
Item (Optional)
Type: Object
The item that is visually presented in a selected state. Expects an item in the same shape as expected by the "items" property.
Default value