Pull-Cord Lamp Toggle

A pendant lamp switched by its pull cord: drag the bead down until it clicks, the cord snaps back elastically and sways, the shade rocks on its wire and the bulb warms into a cone of light with drifting dust.

Try it: Drag the cord bead down and let go — or focus it and press Space.

Installation

Install with the shadcn CLI:

npx shadcn@latest add https://www.framekitui.live/r/pull-cord-lamp-toggle.json

Or, with the @framekit namespace registered: npx shadcn@latest add @framekit/pull-cord-lamp-toggle. You can also copy the source into components/ui/pull-cord-lamp-toggle.tsx (view on GitHub).

Usage

import { PullCordLampToggle } from '@/components/ui/pull-cord-lamp-toggle'

Props

Component props
PropTypeDefaultNotes
checkedboolean—Controlled on/off state.
defaultCheckedbooleanfalseUncontrolled initial state.
onCheckedChange(checked: boolean) => void—Fires when the value flips.
disabledbooleanfalseDisables pointer and keyboard.
labelstring'Reading lamp'Accessible name and caption.
heightnumber300Scene height in px.

Dependencies

  • motion
  • Watchful Eye Toggle

    A soft eye opens and closes; the pupil tracks when open.

  • Theme Reveal Toggle

    A sky-to-night switch: the sun rolls behind a crescent, clouds give way to stars, and the theme change blooms out of the switch as a circular View Transition reveal. Instant swap under reduced motion.

  • Day Night Capsule

    Illustrated mini sky that morphs day↔night.

  • Weather Vane Toggle

    Vane pivots; grain shifts with wind.

  • Glass Orb Switch

    Translucent glass sphere slides on a dark track.

  • Tideglass Toggle

    Waterline rises and falls in a glass pane.

See all 15 Toggles components