Skip to content
Sign upGet access
MicrointeractionsStop snapMenu

Stop snap (Pro)

ProIncluded in $99

The end of a stopped answer, marked by what stopped it: the Stop button's square arcs to the end of the text and settles as the end mark.

ProPress Stop mid answer: the square on the button arcs to the end of the text, lands on the caret and settles as a gray end mark with Stopped written after it.

While an answer streams this is the kit's square caret. Press Stop and the square on the Stop button lifts off, arcs to where the text broke off and lands on the caret with a small squash, then settles into a quiet gray end mark, with Stopped written in after it. The square that means writing, press to stop ends as the full stop of the answer it stopped. An answer that finishes on its own simply loses its caret.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/stop-snap

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 { StopSnap } from "@/components/ui/chatcn/pro/stop-snap"

<p>
  {text}
  <StopSnap status={status} from={stopButtonRef} detail="214 tokens" />
</p>

Put data-stop-square on the square inside your Stop button so the flight starts exactly there; without it the flight starts from the button's centre.

Props

PropTypeNotes
status"streaming" | "stopped" | "done"Done removes it
fromRefObject<HTMLElement>The Stop button
labelstringDefault "Stopped"
detailstringAfter the label, such as a token count

Accessibility

  • The Stopped note is a status, so a screen reader hears that the answer was cut short.
  • The caret and the flying square are aria-hidden.

Motion

  • One 520 ms arc with a quarter turn, sampled into keyframes; the landing squash is 300 ms; the note is revealed with clip-path.
  • Reduced motion: no flight, the note fades in.