Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/toggle.json
Usage
import { Toggle, ToggleIndicator } from "@/components/ui/toggle";
<Toggle> <ToggleIndicator /> </Toggle>
Controlled
Use the pressed and onPressedChange props to control the toggle state programmatically.
❌
State
Disabled
Use the disabled prop to disable the toggle.
Variants
Default
Outline
Sizes
Small
Medium
Large
Examples
Icon Group
Use multiple toggles with icons for toolbar-style controls.
API Reference
Toggle
Toggle button for on/off or selected state. Use asChild for custom elements.
| Prop | Type | Default |
|---|---|---|
variant | outline | ghost | ghost |
size | sm | md | lg | md |
pressed | boolean | - |
defaultPressed | boolean | false |
disabled | boolean | false |
onPressedChange | (details: PressedChangeDetails) => void | - |
className | string | - |
asChild | boolean | false |
ToggleIndicator
Icon or indicator shown when toggle is active. Omitted when used as child.
| Prop | Type | Default |
|---|---|---|
className | string | - |
asChild | boolean | false |
For a complete list of props, see the Ark UI documentation.