---
title: "Slide Action Button"
description: "Free React slide to confirm button: drag the thumb to the end to run the action, release early and it springs back. Touch and keyboard. Framer Motion, shadcn."
category: "Components"
parent: "https://beui.dev/components/motion/expanding-arrow-button"
publishedAt: "2026-07-16"
updatedAt: "2026-11-10"
documentation: "https://beui.dev/components/motion/expanding-arrow-button/slide-action"
markdown: "https://beui.dev/components/motion/expanding-arrow-button/slide-action.md"
license: "MIT"
---

# Slide Action Button

> Free React slide to confirm button: drag the thumb to the end to run the action, release early and it springs back. Touch and keyboard. Framer Motion, shadcn.

## Install

```bash
npx shadcn@latest add @beui/slide-action-button
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

### Slide Action Button usage

Drag the thumb to the end to confirm an action; release early to spring back.

```tsx
"use client";

import { useState } from "react";
import { SlideActionButton } from "@/components/motion/slide-action-button";

export function SlideActionButtonPreview() {
  const [continued, setContinued] = useState(false);

  return (
    <div className="flex flex-col items-center gap-3">
      <SlideActionButton
        completeLabel="Ready"
        onComplete={() => {
          setContinued(true);
          window.setTimeout(() => setContinued(false), 1800);
        }}
      >
        Slide to continue
      </SlideActionButton>
      <p className="h-4 text-xs text-muted-foreground" aria-live="polite">
        {continued ? "Action completed" : "Drag the arrow to the end"}
      </p>
    </div>
  );
}
```

## API Reference

### SlideActionButton

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `completeLabel` | `ReactNode` | — | No | Label shown once the slide completes. Default: "Complete" |
| `threshold` | `number` | `0.82` | No | Fraction of the track (0 to 1) the thumb must pass to complete. Default: 0.82 |
| `resetDelay` | `number` | `1200` | No | Time before the thumb slides back after completing (ms). Default: 1200 |
| `onComplete` | `(() => void)` | — | No | Called when the thumb is released past the threshold, or on Enter or Space. |
| `thumbClassName` | `string` | — | No | Classes merged onto the draggable thumb. |
| `fillClassName` | `string` | — | No | Classes merged onto the fill that trails the thumb. |
| `labels` | `Partial<{ complete: string; thumbLabel: string; }>` | — | No | Override any built-in string. |
| `className` | `string` | — | No | Classes merged onto the root element. |

## More in Animated CTA Buttons

- [Expanding Arrow Button](https://beui.dev/components/motion/expanding-arrow-button/expanding-arrow.md)
- [Hold Action Button](https://beui.dev/components/motion/expanding-arrow-button/hold-action.md)

## Source

- Registry detail: https://beui.dev/r/slide-action-button
- Raw source: https://beui.dev/r/slide-action-button/raw
- GitHub: https://github.com/starc007/ui-components
