Confirm Slide

Slide the thumb to the end to confirm
About this component

Confirm Slide

A slide-to-confirm track for actions that should not happen by accident: the thumb follows the pointer continuously, the label fades as it travels while a soft light runs across the label at rest, and letting go before the end springs the thumb back. Reaching the end, or flicking past halfway, morphs the thumb into a check that draws itself in, swaps the label, fires onConfirm and resets on its own or stays confirmed. It is a real slider for assistive technology: holding the Right arrow slides it through, while End, Enter or Space complete at once. The track is never narrower than its longest label. Destructive or default tone, three sizes, custom thumb icon, and controlled or uncontrolled confirmed state.

Usage

The import and the props worth knowing about, in one place.

import { ConfirmSlide } from "@/components/beste/component/confirm-slide";

<ConfirmSlide
  className="w-full max-w-sm"
  label="Slide to delete the album"
  confirmedLabel="Album deleted"
  tone="destructive"
  onConfirm={() => console.log("Deleted")}
/>

<ConfirmSlide
  label="Slide to publish"
  resetAfter={null}      // stay confirmed
  size="lg"              // "sm" | "default" | "lg"
/>

Keyboard and gestures

Every one of these is in the component already. They are listed because a props table cannot mention a gesture, so nothing else on this page can tell you they exist.

Drag the thumbSlide it to the end, or flick it past halfway, to confirm. Letting go earlier springs it back.
Hold Right arrowSlides the thumb through on key repeat; releasing the key early springs it back.
End, Enter or SpaceConfirm at once, the path for assistive technology.
Left arrow or HomeSend the thumb back to the start.

Props

Read from the component's own type, so this cannot drift from what it accepts.

PropTypeDefaultDescription
label*string—Written on the track, and the thumb's accessible name.
confirmedLabelstring—Shown once the slide completes.
iconReact.ComponentType<{ className?: string }> | React.ReactNode—A lucide icon component, or any node, on the thumb.
onConfirm() => void—
confirmedboolean—Whether the slide shows its confirmed state. Pair with `onConfirmedChange` to control it.
defaultConfirmedboolean—
onConfirmedChange(confirmed: boolean) => void—
resetAfternumber | null—Ms before the confirmed state resets on its own. `null` keeps it.
hintstring—The description read after the label.
disabledboolean—
tone"default" | "destructive"—
size"sm" | "default" | "lg"—
classNamestring—

More Confirm components

View all Confirm
Press and hold to confirm

Deleting the album removes its 9 tracks, the artwork and every play count. This cannot be undone.

TypeBlue Linesto confirm

Type Blue Lines exactly, with the same capital letters.