UI
ToggleGroup
Multi-button toggle supporting single or multi-select mode with size variants.
Quick Preview
Installation
# No extra dependencies
// Copy component fromsrc/components/ui/ToggleGroup.tsx
Usage
import ToggleGroup from '@/components/ui/ToggleGroup'<ToggleGroupoptions={[{ value: 'left', label: 'Left' },{ value: 'center', label: 'Center' },{ value: 'right', label: 'Right' },]}defaultValue="left"onChange={(value) => setAlignment(value as string)}/>
Prompt Preview
Copy a prompt that recreates this UI
Paste this into your AI coding assistant to generate code that closely matches the reference, including color, size, shape, typography, spacing, and polish.
Copy-ready AI prompt
Starts from the current visual reference and project constraints.
Tweak only product-specific copy or data after the first generation pass.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
options* | ToggleGroupOption[] | - | Array of {value, label, disabled?} |
mode | 'single' | 'multiple' | 'single' | Selection mode |
size | 'sm' | 'md' | 'lg' | 'md' | Button size |