kosori

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/toggle

Example

toggle-example.tsx
toggle-example
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

PartPropValues
Togglesizedefault, lg, sm
Togglevariantdefault, outline

On this page