Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Button Group

Segmented horizontal or vertical button groups with dividers and text addons.

Range

Usage

import { button } from "coatx/button";
import {
  buttonGroup,
  buttonGroupSeparator,
  buttonGroupText,
} from "coatx/button-group";

export const ToolbarGroup = () => (
  <div {...buttonGroup()}>
    <span {...buttonGroupText()}>Sort</span>
    <button type="button" {...button({ size: "sm", variant: "outline" })}>
      Newest
    </button>
    <div {...buttonGroupSeparator()} />
    <button type="button" {...button({ size: "sm", variant: "outline" })}>
      Popular
    </button>
  </div>
);

Exports (coatx/button-group)

Export Description
buttonGroup(options?) Group container (orientation: "horizontal", "vertical")
buttonGroupSeparator(options?) Hairline divider (orientation: "vertical", "horizontal")
buttonGroupText(options?) Muted inline text addon matching button height
buttonGroupStyles Compiled StyleX style map

Was this page helpful?