Button group
An EuiButtonGroup is for indicating selection only. They utilize the
type="single"
or "multi"
prop to determine whether multiple or only single selections are allowed per group.In order for groups to be properly read as groups with a title, the legend
prop is required. This is only for accessibility, however, so it will be visibly hidden.
Icon only button groups
If you're just displaying a group of icons, add the prop isIconOnly
.
Button groups in forms
When using button groups within compressed forms, match the form elements by adding buttonSize="compressed"
. Compressed groups should always be fullWidth
so they line up nicely in their small container unless they are icon only.
For a more detailed example of how to integrate with forms, see the
"Complex example" on the compressed forms page.Button group tooltips
Buttons within a button group will automatically display a default browser tooltip containing the button label
text. This can be customized or unset via the title
property in your options
button configuration.
To instead display an EuiToolTip
around your button(s), pass the toolTipContent
property. You can also use toolTipProps
to customize tooltip placement, title, and any other prop that EuiToolTip accepts.
Props
EuiButtonGroup
Prop | Description and type | Default value |
---|---|---|
Prop legend# | Description and type A hidden group title (required for accessibility) string | Default value Required |
Prop onChange# | Description and type Single: Returns the ((id: string, value?: any) => void) | ((id: string) => void) | Default value Required |
Prop className# | Description and type Type: string | Default value |
Prop aria-label# | Description and type Defines a string value that labels the current element. string |