Components / PaperSwitch
Forms
PaperSwitch
Machine-like square toggle with bold state contrast.
← square slider, unapologetically mechanical.
Preview
'use client'
import * as React from 'react'
import { cn } from '@/lib/utils'
export interface PaperSwitchPropsInstallation
Copy this file into your project, export its barrel, and then add it to the master UI index.
- Step 1.Create this file:components/ui/paperSwitch/paperSwitch.tsx⎘
- Step 2.Create the barrel:components/ui/paperSwitch/index.ts⎘
- Step 3.Add this export in
components/ui/index.ts:export * from './paperSwitch'
Variants
Off
On
Props
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | undefined | Controlled checked state. |
defaultChecked | boolean | false | Initial unchecked/checked value. |
onCheckedChange | (checked: boolean) => void | undefined | Callback when state changes. |
Examples
Feature flag
Good for binary product settings in admin surfaces.
<PaperSwitch label="Enable beta banner" />
Privacy mode
Keep label explicit so state meaning is obvious.
<PaperSwitch label="Hide activity from team" />