For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.2.0/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.2.0/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.2.0/en/components/button-group.md.
  • English
  • v0.2.0
  • Button Group

    Live previewHTML · CSS · JavaScript

    Usage

    Include CSS

    Import Tailwind and one full A3S UI style bundle.

    @import "tailwindcss";
    @import "@a3s-lab/ui/a3s.css";

    Or import only the base CSS, the component CSS files it composes, and one style pack.

    @import "tailwindcss";
    @import "@a3s-lab/ui/base.css";
    @import "@a3s-lab/ui/components/button-group.css";
    @import "@a3s-lab/ui/components/button.css";
    @import "@a3s-lab/ui/styles/a3s.css";

    Button Group composes Button styles for the child controls.

    Using CDN or bundler imports? See the Installation page.

    Add your button group HTML

    Wrap related controls in a button-group.

    <div role="group" aria-label="Message actions" class="button-group">
      <button type="button" class="btn" data-variant="outline">Archive</button>
      <button type="button" class="btn" data-variant="outline">Report</button>
    </div>

    Use data-orientation="vertical" to stack items. Use <hr role="separator" /> between items when you need a visible divider, such as a split action. Use direct child <span>, <label>, or <output> elements for non-interactive text segments. Direct child <div> elements are left unstyled for custom layouts.

    Examples

    Orientation

    Use data-orientation="vertical" to stack buttons vertically.

    Live previewHTML · CSS · JavaScript

    Size

    Live previewHTML · CSS · JavaScript

    Nested

    Nest button-group components to keep controls joined within each group while adding spacing between groups.

    Live previewHTML · CSS · JavaScript

    Separator

    Use <hr role="separator" /> to visually divide buttons within a group.

    Live previewHTML · CSS · JavaScript

    Split

    Use a separator to create a split action.

    Live previewHTML · CSS · JavaScript

    Input

    Live previewHTML · CSS · JavaScript

    Input group

    Live previewHTML · CSS · JavaScript
    Live previewHTML · CSS · JavaScript

    Select

    Live previewHTML · CSS · JavaScript

    Popover

    Live previewHTML · CSS · JavaScript

    RTL

    Add dir="rtl" to the group or an ancestor. Flip directional icons explicitly.

    Live previewHTML · CSS · JavaScript