Skip to main content

Starwind UI v3.0 beta is now available! Read the migration guide

Button Group

Installation

Framework Availability

Astro Available React Available

Button Group is available for Astro and React.

Usage

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 ButtonGroup components to create button groups with spacing.

Separator

The ButtonGroupSeparator component visually divides buttons within a group.

Buttons with variant outline do not need a separator since they have a border. For other variants, a separator is recommended to improve the visual hierarchy.

Split

Create a split button group by adding two buttons separated by a ButtonGroupSeparator.

Input

Wrap an Input component with buttons.

Select

Pair with a Select component.

Create a split button group with a dropdown menu.

API Reference

Styled Component API

These props are added or materially changed by the installed Astro styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Follow the Primitive and Runtime links for lower-level behavior props.

Button Group

Inherits div attributes.

Contains the following additional props:

Prop Type Default Toggle details
orientation "horizontal" | "vertical" "horizontal"
Description
Selects the horizontal or vertical layout direction.
Classification
Styled variant

Changelog

v1.1.0

  • Added contract-generated Astro and React implementations while preserving the component’s existing public API and styling.

v1.0.2

  • Refactor tailwind variants functions into separate variants.ts file

v1.0.0

  • Initial release with starwind v1.12