Slide Button

Slide to confirm: drag the knob to the end so the action can't happen by accident.

no dependenciesMIT · free
Slide to pay $49

Installation

npx shadcn@latest add https://ombakui.com/r/slide-button.json

Usage

import { SlideButton } from "@/components/slide-button";

<SlideButton label="Slide to pay $49" doneLabel="Paid" onConfirm={pay} />

Props

PropTypeDefaultDescription
labelReactNode"Slide to confirm"Text on the track.
doneLabelReactNode"Confirmed"Text after confirming.
onConfirm() => void–Called when the knob reaches the end.
thresholdnumber0.9How far (0–1) the knob must travel to confirm.
resetAfternumber2000Milliseconds before resetting after confirming. 0 keeps it done.
classNamestring–