Pluck String

A divider that catches on the pointer as it crosses, bends with it, then slips free and twangs back on a bouncy spring.

  • Divider
  • Interaction
  • SVG

Uses clsx, tailwind-merge

Open in ChatGPTOpen in Claude

Field notes

Small things, done well

Nobody remembers a divider. They remember the one that moved when they brushed past it.

Sweep across the line, or tap it.

Installation

Add the component on its own with the CLI, or copy the file in by hand.

The CLI writes components/ui/pluck-string.tsx and installs clsx and tailwind-merge. It needs the @keyframeui registry in components.json; add it once per project.

npx shadcn@latest add @keyframeui/pluck-string

Examples

Finished sections built with Pluck String. Each one installs whole, with the component included.

Strum

Six strings tuned like a guitar: thicker strings are softer and ring longer. Sweep down across all of them.

Standard tuning

Strum down

e
B
G
D
A
E

Changelog

Faded strings between release notes, with a softer highlight.

Changelog

v2.4.0Oct 2

Springs, everywhere

Every transition now runs on a spring, so interrupting one never snaps.

v2.3.1Sep 18

Quieter dark mode

Borders and dividers sit a step lower, so content leads.

v2.3.0Sep 4

Reduced motion, by default

Movement drops out for people who ask for less. Feedback stays.

Props

pull

TypenumberDefault24

How far the string stretches with the pointer before it slips free, in pixels. It gives less toward the pinned ends.

stiffness

TypenumberDefault900

Spring stiffness of the twang. Higher is a faster, higher-pitched wobble.

damping

TypenumberDefault9

Spring damping of the twang. Lower values ring for longer.

strokeWidth

TypenumberDefault1

Stroke width of the string, in pixels.

fade

TypebooleanDefaultfalse

Fade the string out toward both ends.

highlightClassName

Typestring

Classes for the highlight that lights up the string as it swings. Set its color with text-* (defaults to text-foreground).

className

Typestring

Extra classes for the root. Its height (default h-14) is the grab zone and the spacing around the line; set the string color with text-* (defaults to text-border).