Button Group

A container that groups related buttons together with consistent styling.

Orientation

Set the orientation prop to change the button group layout.

Size

Control the size of buttons using the size prop on individual buttons.

Nested

Nest components to create button groups with spacing.

Separator

Some buttons don't need a separator since they have a border. For other variants use a Separator to improve the visual hierarchy.

Split

Create a split button group using a Separator.

Input

Wrap an Input component with buttons.

Input Group

Wrap an InputGroup component to create complex input layouts.

Dropdown Menu

Create a split button group with a DropdownMenu component.

Select

Pair with a Select component.

Popover

Use with a Popover component.

Start a new task with Copilot

Describe your task in natural language.

Copilot will open a pull request for review.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::*;

#[component]
pub fn ButtonGroupAnatomy() -> impl IntoView {
    view! {
        <ButtonGroup>
            <Button />
            <ButtonGroupSeparator />
            <ButtonGroupText />
        </ButtonGroup>
    }
}

API Reference

ButtonGroup

Contains the Buttons that make up the ButtonGroup.

Custom Attributes
NameTypeDefaultDescription
verticalboolfalse

Sets the display direction of the ButtonGroup.

Implements global attributes.

ButtonGroupSeparator

Visually separates button group buttons.

Custom Attributes
NameTypeDefaultDescription
verticalboolfalse

Toggle whether or not the separator should display vertically.

Implements global attributes.

ButtonGroupText

Creates a styled text element for use in the ButtonGroup.

Implements global attributes.