Pull cord
A light switch on a pull cord. Pull the bead down past the click point and let go to switch; the cord springs back up, bounces and sways with the sideways pull you gave it.
Light on
When to use
- Theme or lighting switches on expressive marketing pages and playful apps.
- A single delightful toggle in an otherwise calm interface.
When not to use
- Settings lists; use `Switch`.
- Anything people toggle often.
Installation
pnpm dlx shadcn@latest add @caliper/pull-cord
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
PullCord
4 props
Also accepts the native props of its root element and a ref.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes switch semantics, with aria-hidden, aria-checked and aria-label kept in step with state.
Motion
- State changes animate with the library's shared durations and curves, so its timing matches every other part.
- Under reduced motion each change lands on its end state without movement; nothing is hidden or skipped.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/pull-cord.mdThe index of every part is at /llms.txt.