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 PaperSwitchProps

Installation

Copy this file into your project, export its barrel, and then add it to the master UI index.

  1. Step 1.Create this file:
    components/ui/paperSwitch/paperSwitch.tsx
  2. Step 2.Create the barrel:
    components/ui/paperSwitch/index.ts
  3. Step 3.Add this export in components/ui/index.ts:
    export * from './paperSwitch'

Variants

Off

On

Props

PropTypeDefaultDescription
checkedbooleanundefinedControlled checked state.
defaultCheckedbooleanfalseInitial unchecked/checked value.
onCheckedChange(checked: boolean) => voidundefinedCallback 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" />