Inputs & Switches
Pull Cord
A lamp cord on a short swinging chain: pull it and the room turns from warm day to a dusk lit only near the shade. A role=switch toggle.
svgmedium complexitymoderate motionpointer+keyboardmobile-readyaccessible
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
A day / evening or light / dark switch that should feel physical.
When not to
Dense settings lists or a toggle that needs a text label.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Matte paper register (clay shade, charcoal cord, warm bulb; day #F4F1EA, dusk #22211D). Edit --pc-* tokens; SEG and N set cord length; PULL sets the click.
Safe to edit
- --pc-* tokens (day and evening)
- room SVG
- SEG, N, PULL
Keep intact
- IIFE + prefix, reduced-motion, visibilitychange, theme hook, demo-v1
Known limitations
- Demo state resets on remount
More Inputs & Switches components
- Liquid ToggleSVG liquid toggle with a goo filter, trailing droplets and a native button. First deliberate input stops the idle demo; the chosen on/off state settles fully.
- Glow SliderSVG range slider with a muted plum-to-teal fill, glow and value bubble, driven by a native range input. First input stops demo oscillation; drag and…
- Spring StepperMint stepper with native minus/plus buttons and a number reel that settles with spring feedback. First deliberate input stops automatic steps; the chosen…
- Segmented ControlSlate-to-sage pill slides between four native segment buttons with elastic spring stretch. First input stops automatic cycling; committed selection remains.
- Checkbox MorphThree native amber checkbox buttons animate their check strokes and expose pressed state. First input stops the demo; checked values remain.
- Star RatingFive gold SVG star radio controls commit ratings on click or keyboard input and settle with a scale bounce. First input stops automatic sweeping.