Overview
ToggleMenu is a segmented button group. It provides a toggle UI where only one option can be selected at a time.
- Compound — Group + Item
- Icon + Label — Can display icon only, label only, or both
- One size — 32px tall. There is no
size prop
- States — selected (
aria-pressed), hover on unselected items, keyboard focus ring inside the item
Basic Usage
Icon Mode
Sub-components
| Prop | Type | Default | Required | Description |
|---|
children | ReactNode | - | Yes | Items |
1px border with an 8px radius. The first and last items get a 7px radius (8 minus the border) instead of clipping with overflow: hidden, so the focus ring is never cut off.
| Prop | Type | Default | Required | Description |
|---|
item | ToggleGroupItem | - | Yes | One cell ({ value, icon?, label?, ariaLabel? }) |
index | number | - | Yes | Position in the group. Above 0 it draws a 1px divider before the cell |
value | string | - | Yes | The selected value |
onChange | (value: string) => void | - | Yes | Called with the cell value when it is pressed |
Colors
| Part | Selected | Not selected |
|---|
| Background | background.default.secondary | background.default.default (hover: defaultHover) |
| Icon | icon.default.default | icon.default.secondary (4.6:1) |
| Label | text.default.default | text.default.secondary |
ToggleGroupItem Type
export type ToggleGroupItem<T extends string = string> = {
value: T
icon?: IconName
label?: string
ariaLabel?: string
}
Sizes
| Size | Dimensions |
|---|
small | 28 × 28 px |
medium | 32 × 32 px |
Specification
base
| 상태 | 요소 | 속성 | 값 |
|---|
| enabled | group | borderWidth | $size.stroke.border |
| enabled | group | borderColor | $color.border.default.default |
| enabled | group | borderRadius | $size.radius.200 |
| enabled | item | gap | $size.space.100 |
| enabled | item | height | 32px토큰 아님 — no sizing token scale |
| enabled | item | backgroundColor | $color.background.default.default |
| enabled | icon | color | $color.icon.default.secondary |
| enabled | label | typography | $text.caption |
| enabled | label | color | $color.text.default.secondary |
| hover | item | backgroundColor | $color.background.default.defaultHover |
| selected | item | backgroundColor | $color.background.default.secondary |
| selected | icon | color | $color.icon.default.default |
| selected | label | color | $color.text.default.default |
Guidelines
- Use when there are 3 or fewer options — for more options, use BasicSelector
- Always specify
ariaLabel when using icons only
index is used for rendering vertical dividers between items