# Segmented Button Group

> The SegmentedButtonGroup component is a clean and flexible button group built entirely with shadcn UI. It visually splits a single button into multiple segments, allowing users to toggle between options like “Day / Week / Month” or priority levels. Each segment acts as an individual button, with the active segment highlighted while others remain outlined, creating a clear and intuitive selection interface. The component dynamically supports any number of segments, maintains rounded corners on the first and last buttons for a seamless appearance, and provides callbacks for handling user selection. Its simple yet elegant design makes it ideal for dashboards, filters, and interactive toggle controls in modern web applications.

- Author: [Ruixen UI](https://21st.dev/@ruixen.ui)
- Library: [Ruixen UI](https://21st.dev/@ruixen.ui/library/ruixen-ui)
- License: unknown
- Live preview: https://21st.dev/@ruixen.ui/components/segmented-button-group

## Install

```bash
npx shadcn@latest add "https://21st.dev/r/ruixen.ui/segmented-button-group?api_key=$API_KEY_21ST"
```

Requires a 21st API key (generate one at https://21st.dev/mcp) passed as `API_KEY_21ST`. Free accounts get a limited number of installs per day; unlimited on a paid plan — see https://21st.dev/pricing.

Full component directory: https://21st.dev/llms.txt
