Skip to content
Sign upGet access
MicrointeractionsLength dragMenu

Length drag (Pro)

ProIncluded in $99

An answer you make shorter or longer by hand, with a handle that unfolds or folds away its sentences.

ProDrag the handle under the answer: held back sentences unfold into place, lit for a moment; drag up and the least important fold away.

Under the answer sits a handle. Drag it down and the sentences that were held back unfold into place, lit for a moment so you see what was added; drag it up and the least important ones fold away while the paragraph closes around what is left. The answer keeps its order at every length. Give each sentence a rank: 1 is essential.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/length-drag

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { LengthDrag } from "@/components/ui/chatcn/pro/length-drag"

<LengthDrag sentences={[{ text, rank: 1 }, ...]} value={length} onValueChange={setLength} />

Props

PropTypeNotes
sentences{ text, rank }[]Higher ranks drop first
value / onValueChangenumberHow many ranks show
stepnumberPixels of drag per step. Default 22

Keyboard

KeyAction
ArrowDown / ArrowRightLonger
ArrowUp / ArrowLeftShorter
Home / EndShortest or longest

Accessibility

  • A vertical role="slider" read as "4 of 7 sentences".

Motion

  • New sentences arrive with an accent tint that fades over 1.1 s; leaving ones fade 200 ms; the paragraph height eases 280 ms.
  • Reduced motion: sentences swap in place.