Bend Text, animated React component
- Pro
- Motion Effects
- Spring
A line of type running along a string that you can grab and pull, with the words flowing round the bend. Let go and an underdamped spring twangs it back, overshooting a few times before it lies flat.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| text | string | "PLUCK THE LINE · MAKE IT SING · " | One repeat of the text on the string; it is repeated four times so the line stays full. |
| accent | string | "#0071e3" | Colour of the grab point and the focus ring. |
| hint | string | "Grab the line, pull, and let go." | Caption under the stage. An empty string hides it. |
| onPluck | (pull: number) => void | — | Called on release with how far the string was pulled from rest, in stage units. |
| autoplay | boolean | false | Plucks the string every 2.6s until someone touches it. |
| className | string | — | Extra classes for the root element. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Bend Text is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Bend Text works
pull, and the string bends under your hand with the words flowing round the curve. Let go and it twangs back, overshooting a few times before it lies flat again.
The source, the install command and the build prompt come with Pro.
Bend Text questions
How do I install Bend Text?
Run `npx shadcn@latest add @nexus-labs/bend-text`. It adds the component and installs framer-motion. It is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).
How do I change the text on the string?
Pass `text` as one repeat of the line; it is repeated four times along an SVG `textPath` and drifts slowly along the string. The default ends with a separator and a space so repeats do not run together. With reduced motion on, the drift stops.
Can I change the color and the caption?
`accent` (default `#0071e3`) colors the grab point and the focus ring. `hint` is the caption under the stage; pass an empty string to hide it. The text color follows light and dark mode through the `dark:` classes.
How do I react when the string is plucked?
Pass `onPluck`. It is called on release with how far the string was pulled from rest, in stage units, so you can trigger something on a big pull. Keyboard plucks call it too.
Can I pluck it with the keyboard?
Yes. The stage is focusable with `role="button"`. Enter, Space and ArrowUp pluck it upward, ArrowDown pulls it down, and ArrowLeft and ArrowRight pluck from other points on the string. The spring is underdamped, so it overshoots a few times before settling.

