HTML + CSSToggles

Pull cord lamp toggle

A banker’s lamp with a pull cord: drag the bead down or tap it and the light comes on with a swing.

Settings

16px
1x

Code

<label class="uvq03-pcd"><input type="checkbox" role="switch"><span class="lm"><i class="cn"></i><i class="cb"></i><i class="sh"></i><i class="bu"></i><span class="cd"><i class="bd"></i></span></span>Reading lamp</label>

Prompt for AI

Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.

Markdown version with all the code, for AI assistants

More in Toggles

See all Toggles

Where to use it

This switch is a hanging green lamp with a small pull cord and a wooden bead. You can drag the bead down and release it, as with a real cord switch, or simply click or tap anywhere on the lamp. The bulb glows, a warm cone of light appears, and the cord swings back and forth before settling. A short script handles the drag for mouse and touch.

The main color is the shade and the second one is the light. Brass and amber give a library feel, while white and cool blue look like a modern pendant. Space still toggles it from the keyboard.