Select
Dropdown for single option selection
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Selected value |
onValueChange | (value: string) => void | - | Change handler |
disabled | boolean | false | Disable select |
placeholder | string | - | Placeholder text |
MultiSelect
Dropdown for selecting multiple options
| Prop | Type | Default | Description |
|---|---|---|---|
options | { label: string; value: string }[] | - | Available options |
selected | string[] | [] | Selected values |
onChange | (values: string[]) => void | - | Change handler |
placeholder | string | - | Placeholder text |
Switch
Toggle switch for on/off states
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | false | Checked state |
onCheckedChange | (checked: boolean) => void | - | Change handler |
disabled | boolean | false | Disable switch |
Checkbox
Checkbox for boolean selection
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | "indeterminate" | false | Checked state |
onCheckedChange | (checked: boolean) => void | - | Change handler |
disabled | boolean | false | Disable checkbox |
RadioGroup
Radio buttons for mutually exclusive selection
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Selected value |
onValueChange | (value: string) => void | - | Change handler |
disabled | boolean | false | Disable all options |
Toggle
Single toggle button with pressed state
| Prop | Type | Default | Description |
|---|---|---|---|
pressed | boolean | false | Pressed state |
onPressedChange | (pressed: boolean) => void | - | Change handler |
variant | "default" | "outline" | "default" | Visual variant |
disabled | boolean | false | Disable toggle |
ToggleGroup
Group of toggle buttons for single or multiple selection
| Prop | Type | Default | Description |
|---|---|---|---|
type | "single" | "multiple" | - | Selection mode |
value | string | string[] | - | Selected value(s) |
onValueChange | (value) => void | - | Change handler |
variant | "default" | "outline" | "default" | Visual variant |
TagInput
Free-form tag entry with keyboard shortcuts
react
typescript
| Prop | Type | Default | Description |
|---|---|---|---|
tags | string[] | [] | Current tags |
onTagsChange | (tags: string[]) => void | - | Change handler |
placeholder | string | - | Input placeholder |
maxTags | number | - | Maximum number of tags |
import { TagInput } from '@/ui/primitives';
const [tags, setTags] = useState<string[]>(['react']);
<TagInput
tags={tags}
onTagsChange={setTags}
placeholder="Add tags..."
/>