Branch
Variant navigation for branched messages: ‹ N / M › controls that let users compare alternative AI responses. Purely presentational — you swap the content.
npx @slipstream-ui/cli@latest add branchVariant switching
Assistant
The capital of France is Paris.
1 / 3
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | — | Total variants; renders nothing below 2. |
| selected | number | — | Controlled zero-based index. |
| defaultSelected | number | 0 | Uncontrolled initial index. |
| onSelect | (index: number) => void | — | Called with the chosen variant index. |
| labels | object | — | Overrides for previous/next aria-labels. |
Accessibility
- Arrows disable at the ends instead of wrapping silently.
- Position indicator uses aria-live=polite.
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+ — macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA — the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.