tapcn
Components

Slide To Action

A slide-to-confirm button for destructive or important actions.

Slide to confirm

Slide To Action

A slide-to-confirm interaction that requires the user to drag a thumb across a track to trigger an action. Ideal for destructive or irreversible operations that need deliberate confirmation.

Installation

npx @tapcn/cli add slide-to-action

Or using shadcn directly:

npx shadcn@latest add https://tapcn.vercel.app/r/slide-to-action.json

Usage

import { SlideToAction } from '~/components/ui/slide-to-action';

export function SlideToActionExample() {
  return (
    <SlideToAction
      label="Slide to confirm"
      completedLabel="Confirmed"
      onSlideComplete={() => {
        console.log('Action confirmed!');
      }}
    />
  );
}

Props

PropTypeDefaultDescription
onSlideComplete() => void-Callback fired when the slide reaches the completion threshold.
labelstring'Slide to confirm'Text displayed on the track before completion.
completedLabelstring'Confirmed'Text displayed on the track after completion.
iconReact.ReactNode<ChevronsRight />Custom icon to render inside the draggable thumb.
disabledbooleanfalseWhen true, the slider cannot be dragged.
classNamestring-Additional CSS classes for the container.

Dependencies

  • react-native-reanimated
  • lucide-react-native

On this page