Skip to content
Sign upGet access
MicrointeractionsSlide to approveMenu

Slide to approve (Pro)

ProIncluded in $99

Slide to confirm for payments, sends and deletes: ink follows the thumb, the words invert as it passes, and a short slide is thrown back.

ProDrag the thumb: ink fills the track and the words invert as it passes. Let go early and it is thrown back; reach the end and it pays.

Drag the thumb and the track fills in ink behind it; the words turn to paper as the ink passes over them. Let go short of the end and the thumb is thrown back with one small overshoot, the one place the kit allows one, because your hand threw it. A quick flick counts: the release projects where the throw would land. At the end the thumb becomes a run check while the action works, then lands on a check.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/slide-to-approve

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 { SlideToApprove } from "@/components/ui/chatcn/pro/slide-to-approve"

<SlideToApprove
  label="Slide to pay €64.20"
  status={status}
  labels={{ working: "Paying", done: "Booked, ticket sent" }}
  onConfirm={pay}
/>

Examples

States

ProThe slider at rest, sending, sent with its receipt line, and the bank declining.

Props

PropTypeNotes
labelstringThe track text and the accessible name
onConfirm() => voidOn reaching the end, or on Enter
status"idle" | "working" | "done" | "error"Back to idle glides the thumb home
labels{ working?, done?, error? }Track text per later status
thresholdnumberHow far the thumb must travel, 0 to 1. Default 0.86
disabledboolean

Keyboard

  • Enter or End on the focused thumb confirms.

Accessibility

  • role="slider" with the current status as aria-valuetext, so a screen reader hears Paying and then the result.
  • Past either end the thumb resists like a rubber band instead of stopping dead.
  • In a right to left layout the thumb travels the other way.

Motion

  • Drag writes the thumb, the ink clip-path and the label fade in the same frame. The release hands the measured velocity to the spring.
  • Reduced motion: the thumb returns without the throw.