WebberUI

Elastic Rope Divider

A pluckable rubber-band divider that bounces and oscillates when pulled and released.

Like a taut rubber band stretched between sections: the pointer coming close snaps it into a V that follows the cursor, and releasing (or pulling past the limit so it slips out of your grip) sends it oscillating back on a damped spring, carrying the momentum from the instant of release. The physics is a hand-written rAF damped spring driving the control point of a quadratic bezier, and the loop stops itself once it settles at rest.

Loading preview…
npx shadcn@latest add https://webberui.com/r/elastic-rope-divider.json

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

2
0
110
28
<ElasticRopeDivider />

Installation

npx shadcn@latest add https://webberui.com/r/elastic-rope-divider.json

Or, once registries are configured in components.json, install it as @webberui/elastic-rope-divider.

Usage

import { ElasticRopeDivider } from "@/components/ui/elastic-rope-divider";

<section>Previous section</section>
<ElasticRopeDivider className="text-neutral-300 dark:text-neutral-700" />
<section>Next section</section>

{/* Customized: a thicker colored rope with a natural sag */}
<ElasticRopeDivider color="#f43f5e" thickness={3} sag={12} />

Props

PropTypeDefaultDescription
colorstring"currentColor"Rope color; inherits the text color by default, so an outer text-* class can control it
thicknessnumber2Line thickness (px)
sagnumber0Natural sag at rest (px); 0 is a perfectly straight line
heightnumber64Height of the interactive hit area (px), with the rope vertically centered inside it
maxStretchnumber110Stretch limit (px); pulling past it makes the rope slip out of your grip and snap back
grabRadiusnumber28How close (px) the pointer must come for the rope to snap to it and follow
classNamestringForwarded to the outer container

Accessibility

  • Marked with role="separator" plus aria-orientation="horizontal", so assistive technology treats it as an ordinary horizontal divider
  • The SVG itself is marked aria-hidden; the plucking interaction is purely decorative and carries no content or operation
  • When the user has "reduce motion" enabled at the system level, snapping, dragging, and bouncing are disabled and only a static rope line is rendered
  • The component is not focusable and does not intercept Tab order, so keyboard navigation is entirely unaffected

On this page