Component packs › Gnomon › Lamp Toggle

Lamp Toggle

Turn the lamp on and its head swings down onto the desk, and the light of the whole page moves to it: every Gnomon shadow swings away and stretches long.

Lamp Toggle is a toggle from Gnomon, a component pack with 6 shadow controls: One light for the whole page: switch on the lamp and every control swings its shadow away from it. Price: $2 for the whole pack.

Built with: page-wide light, jointed arm, warm light pool.

Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.

Lamp Toggle props

PropTypeDefaultDescription
checkedboolean
labelstring
disabledboolean
darkboolean
drivesLightbooleantrueMove the page light with the lamp. Default true.
onChange(on: boolean) => void
autoplaynumber | falseShowcase mode: switches every N ms while visible.

Methods on the ref

Use it in React

import LampToggle from './LampToggle';

<LampToggle />

The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.

More in Gnomon

Good for: Skeuomorphic UI.