Button patterns
Split button Pattern
EUI
does not support split buttons specifically. Instead, use separate buttons for the main and overflow actions. This pattern is achieved by setting thedisplay
and size
props on EuiButtonIcon to match that of the primary button.Loading...
Toggle button Pattern
A toggle button can be built with any button including the standard EuiButton, EuiButtonEmpty , or EuiButtonIcon. Use state management to handle the visual differences for on and off.
Consider the followingn exception cases when building a toggle button.
- If your button changes its readable text, via children or
aria-label
, then there is no additional accessibility concern.
Loading...
- If your button only changes the visual appearance, you must add
aria-pressed
passing a boolean for the on and off states. All EUI button types provide a helper prop for this calledisSelected
.
Accessibility recommendation
Do not add aria-pressed
or isSelected
if you also change the readable text.
Loading...