Pull cord toggle

Pro

A switch on a cord: a verlet rope you grab and pull; past a threshold it clicks over, then the handle bounces and swings to rest. A click or Enter tugs it for you.

A recording of the component itself. With Pro you get its full source and it runs in your app.

What you get

  • Verlet rope that swings, recoils and settles
  • Pull past the threshold to toggle, in any direction
  • Click, Enter or Space gives it a tug for you
  • Controlled checked: tugs itself when changed outside
  • One TypeScript file in your project, yours to edit. No runtime package.
  • Keyboard, screen reader and reduced motion support; light and dark; your shadcn theme.

Install

npx shadcn@latest add @goodui-pro/pull-cord-toggle

Needs a Pro license key in your registry config: two-minute setup. The file lands in components/goodui/pull-cord-toggle.tsx.

More Pro components

Slide to confirm

A slide to confirm track: released short, the thumb springs home with your speed; past the line it pops and pulls to the end like a magnet, spins while the async confirm runs and floods the track with a drawn check.

Pro

Split button

A primary action with a chevron menu: a highlight glides between items, typeahead and full keys, a spinner on the primary, a merge-button mode, and an expanding button group that fans out actions.

Pro

Icon morph button

A toggle button whose icon bends from one shape into another: paths are resampled to equal points, aligned for the least travel and morphed on a spring with overshoot, with eight built-in pairs and custom paths.

Pro