Get License
Free
Pro

Button Group

Group Buttons a series of buttons together on a single line, use to toggle content.

free

Default Button Group

Button group example below.


HTML

Disabled Button

If need to disable certain button, add to the preferred <base-group-button-item> the attribute disabled="true".


HTML

Group Button with icon

Add base-icon with preferred name inside <base-group-button-item>


HTML

Sizes

Use the size property to change the height of the button group. Available sizes match our standard buttons: 'sm' | 'default' | 'lg' | 'xl' | 'xxl'.


HTML

Installation

Run the following command to add this component to your project:

bash

npx base-ui-cli add button-group

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.

bash

npx -y base-ui-mcp

Base UI provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// Install: npx base-ui-cli add button-group
// Paths are relative to aliases.components (default: src/app/components)
import { ButtonGroupComponent } from './button-group/button-group.component';
import { ButtonGroupParent } from './button-group/button-group.token';
import { GroupButtonComponent } from './button-group/group-button/group-button.component';
import { ToggleButtonService, ToggleGroupButton } from './button-group/toggle-button.service';

@Component({
  selector: 'app-your-component',
  imports: [
    ButtonGroupComponent,
    GroupButtonComponent
  ],
  template: `...`
})
export class YourComponent {
  private toggleButton = inject(ToggleButtonService);
}

API for button-group — generated from JSDoc in the library source.

API reference for button-group
APIMemberTypeDefaultDescription
ToggleButtonServicesetSelectedButton()(value: ToggleGroupButton) => voidCalls setSelectedButton.
ButtonGroupParentsizeSignal<GroupButtonSize>
ToggleGroupButtonactiveWritableSignal<boolean>
base-button-groupclassstring''Additional host CSS classes (merged via cn()).
base-button-groupsizeGroupButtonSize'default'Shared size for all items in the group. Matches button / icon-button heights (`sm` = 28px, `default` = 36px, etc.).
base-button-group(valueChange)voidEmits when valueChange occurs.
base-group-button-itemclassstring''Additional host CSS classes (merged via cn()).
base-group-button-itemiconstring | undefinedundefined
base-group-button-itemdisabledbooleanfalse
base-group-button-itemvalueunknownundefined
base-group-button-itemsizeGroupButtonSize | undefinedundefinedOptional size override. When omitted, inherits from the parent `base-button-group`.