Length drag (Pro)
ProIncluded in $99An answer you make shorter or longer by hand, with a handle that unfolds or folds away its sentences.
On this page
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
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
import { LengthDrag } from "@/components/ui/chatcn/pro/length-drag"
<LengthDrag sentences={[{ text, rank: 1 }, ...]} value={length} onValueChange={setLength} />Props
| Prop | Type | Notes |
|---|---|---|
sentences | { text, rank }[] | Higher ranks drop first |
value / onValueChange | number | How many ranks show |
step | number | Pixels of drag per step. Default 22 |
Keyboard
| Key | Action |
|---|---|
ArrowDown / ArrowRight | Longer |
ArrowUp / ArrowLeft | Shorter |
Home / End | Shortest 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.