A control that allows the user to toggle between checked and not checked. Plays a toggle sound.
A control that allows the user to toggle between checked and not checked. The sensory-ui Checkbox plays a toggle sound on state change, confirming the binary state transition.
Pattern: Single-sound
npx shadcn@latest add SatyamVyas04/sensory-ui/sensory-ui-checkboximport { Checkbox } from "@/components/ui/sensory-ui/checkbox";| Prop | Type | Default | Description |
|---|---|---|---|
sound | SoundRole | false | "interaction.toggle" | Sound played on toggle. |
volume | number | 1 | Per-component volume multiplier (0–1). |
interaction.toggle
<div className="flex items-center space-x-2">
<Checkbox id="terms" />
<label htmlFor="terms">Accept terms</label>
</div><Checkbox sound="interaction.confirm" volume={0.7} /><Checkbox sound={false} /><Checkbox id="terms" sound="interaction.confirm" />
{/* More rewarding sound for important agreements */}<Checkbox id="filter-1" sound="interaction.toggle" volume={0.5} />
{/* Subtle sound for frequent filter toggling */}<Checkbox id="task-1" sound="interaction.confirm" />
{/* Satisfying confirmation when completing a task */}| Prop | Value |
|---|---|
sound | "interaction.toggle" |
volume | 1 |
| Situation | Recommended Sound | Why |
|---|---|---|
| Terms / agreements | interaction.confirm | More significant toggle |
| Filter options | interaction.toggle | Standard state change |
| Task completion | interaction.confirm | Rewarding completion |
| Settings toggle | interaction.toggle | Standard toggle |
| Bulk selection | interaction.subtle | Lighter for repeated use |
| Event | Default Sound |
|---|---|
| Toggle checked/unchecked | interaction.toggle |
View the original Checkbox documentation.