Toggle
A two-state button that can be toggled on or off.
Toggle wraps the Base UI
Toggle primitive with cva
variants for size and variant, and marks itself with data-slot.
Installation
npx shadcn@latest add @kosori/toggleExample
toggle-example.tsx
import { Toggle } from '@/components/ui/toggle';
const ToggleExample = () => <Toggle>Toggle</Toggle>;
export default ToggleExample;
Usage
import { Toggle } from '@/components/ui/toggle';
const ToggleDemo = () => <Toggle>Toggle</Toggle>;Variants
| Part | Prop | Values |
|---|---|---|
Toggle | size | default, lg, sm |
Toggle | variant | default, outline |