Slide to Confirm

Slide to Confirm is a copy-paste React component that stops pocket tap sent a payment before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/slide-to-confirm
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 2 extra npm packages
  • A11y guidance in docs

StopsPocket tap sent a payment

Was this component page useful?

How do I install Slide to Confirm?

pnpm dlx shadcn@latest add @bollard/slide-to-confirm

The files land in your project. They're yours to edit.

How do I use Slide to Confirm in React?

slide-to-confirm-usage.tsx
import { SlideToConfirm } from "@/components/ui/slide-to-confirm"

<SlideToConfirm
  label="Slide to pay ₹499"
  pendingLabel="Paying…"
  confirmedLabel="Paid ₹499"
  resetAfter={2500}
  onConfirm={() =>
    new Promise<void>((resolve) =>
      setTimeout(() => {
        setLog("Payment sent to Chai Point.")
        resolve()
      }, 900),
    )
  }
/>

What input mistakes does Slide to Confirm catch?

  • Taps and short drags that don't reach the threshold
  • Held arrow keys (auto-repeat) that would otherwise complete it
  • Repeat confirms while an async confirm is pending
  • Failed confirms, which slide back

What props does Slide to Confirm accept?

SlideToConfirm props
PropTypeDefault
onConfirm* (required)

Runs once the thumb reaches the end. Return a promise to show a pending state; a rejection slides it back.

() => void | Promise<void>—
label

Text shown in the track, and the slider's accessible name.

string"Slide to confirm"
pendingLabel

Text shown while an async `onConfirm` is running.

string"Working…"
confirmedLabel

Text shown once confirmed.

string"Done"
threshold

How far (0 to 1) the thumb must travel before it counts.

number0.9
resetAfter

Milliseconds before resetting after confirm. 0 keeps it confirmed.

number0
variant

Visual style.

keyof typeof variants"default"
size

Size of the track.

keyof typeof sizes"default"
disabled

Disables the slider.

boolean—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Slide to Confirm accessible?

  • role=slider with aria-valuenow/valuetext and an aria-label from label
  • Keyboard operable; holding a key won't complete the slide
  • Phase text in a polite live region; aria-disabled while locked
  • Spring animation respects reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: For payments, keep server-side idempotency and authorization; this only reduces accidental triggers.

  • An accidental full slide still confirms
  • A UX guard, not authorization

What expensive mistakes does Slide to Confirm stop?

Pocket tap sent a payment

Also known as

swipe to pay · slide to confirm · swipe button · upi pay · slider · mobile checkout · end ride · pay now

Field type

What dependencies does Slide to Confirm require?

Slide to Confirm facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameSlide to Confirm
Registry identifier@bollard/slide-to-confirm
Install commandnpx shadcn@latest add @bollard/slide-to-confirm
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Slide to Confirm

How does Slide to Confirm validate Indian financial identifiers?

Slide to Confirm stops pocket tap sent a payment. Complies with national standards for Taps and short drags that don't reach the threshold, Held arrow keys (auto-repeat) that would otherwise complete it, Repeat confirms while an async confirm is pending, Failed confirms, which slide back. Limitation: verify slide-to-confirm with issuer gateway.

How do I install slide-to-confirm with shadcn?

Run `npx shadcn@latest add @bollard/slide-to-confirm`. Sources added: registry/default/slide-to-confirm/slide-to-confirm.tsx. Package requirements: lucide-react, motion.

What props customize Slide to Confirm?

Slide to Confirm accepts `onConfirm`, `label`, `pendingLabel`, `confirmedLabel`, `threshold`. Configures swipe to pay, slide to confirm, swipe button behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of slide-to-confirm?

An accidental full slide still confirms. A UX guard, not authorization Server requirement: For payments, keep server-side idempotency and authorization; this only reduces accidental triggers.

How does Slide to Confirm meet accessibility guidelines?

role=slider with aria-valuenow/valuetext and an aria-label from label. Keyboard operable; holding a key won't complete the slide. Phase text in a polite live region; aria-disabled while locked. Spring animation respects reduced motion. Minimizes errors: accidental tap sent payment, pocket press ended session.

Which components pair with Slide to Confirm?