@zendeskgarden/react-buttons package provides a set of accessible button components that cover the full range of interaction patterns: primary actions, icon-only buttons, toggle states, split-button menus, and more.
Installation
Place a
ThemeProvider from @zendeskgarden/react-theming at the root of your React application. All Garden components must be rendered inside a ThemeProvider.Button
The coreButton component renders an accessible <button> element. Use the appearance props to communicate intent.
Basic usage
With icons
UseButton.StartIcon and Button.EndIcon to place icons at either end of a button label. Pass isRotated to animate a chevron.
Props
Applies primary (filled) button styling.
Applies danger styling. Can be combined with
isPrimary for a filled danger button.Applies basic (borderless) button styling.
Renders the button with link (anchor) styling and an underline.
Applies neutral color styling.
Applies pill-shaped (fully rounded) button styling.
Stretches the button to fill its container width.
Controls the button size.
Applies an inset
box-shadow on focus instead of an outset ring.Button.StartIcon props
Rotates the icon 180 degrees. Useful for open/close chevrons.
Button.EndIcon props
Rotates the icon 180 degrees. Useful for open/close chevrons.
IconButton
IconButton renders an icon-only button with no visible label. Defaults to isBasic and isPill styling. Always provide an aria-label for accessibility.
Props
IconButton accepts all Button props except isStretched and isLink, plus:
Rotates the icon 180 degrees.
ToggleButton
ToggleButton extends Button to manage a pressed/unpressed state via the isPressed prop. It sets aria-pressed automatically.
Props
ToggleButton accepts all Button props, plus:
Indicates whether the button is in a pressed state. Use
"mixed" when the toggle controls multiple elements with different values.SplitButton
SplitButton groups a primary action button alongside a ChevronButton (or IconButton) for a dropdown trigger. The context automatically applies inset focus styling to grouped buttons.
ChevronButton
ChevronButton is a pre-built IconButton that renders a downward-pointing chevron icon. Use it as the dropdown trigger in a SplitButton.
ChevronButton accepts the same props as IconButton. Its defaults are isBasic={false} and isPill={false}.
Anchor
Anchor renders an accessible <a> element styled to match Garden’s button link style.
Props
Applies danger (red) link styling.
Attaches
target="_blank" and rel="noopener noreferrer" and renders an external link icon.Accessible label for the external link icon. Provide a translated string when targeting non-English locales.
Shows an underline on the anchor.
ToggleIconButton
ToggleIconButton combines IconButton with toggle behavior. Set isPressed to control its state and aria-label for screen readers.
ToggleIconButton accepts all IconButton props plus the isPressed prop from ToggleButton.
Exports
The following are exported from@zendeskgarden/react-buttons:
| Export | Description |
|---|---|
Button | Base button with Button.StartIcon and Button.EndIcon subcomponents |
Anchor | Styled anchor element |
ChevronButton | Icon button pre-loaded with a chevron icon |
IconButton | Icon-only button |
SplitButton | Wrapper for grouped action + dropdown buttons |
ToggleButton | Button with aria-pressed state management |
ToggleIconButton | Icon-only button with aria-pressed state management |