---
title: "Animated CTA Buttons"
description: "Expressive call-to-action buttons with expanding, hold, and slide interactions."
category: "Components"
publishedAt: "2026-07-16"
updatedAt: "2026-11-10"
documentation: "https://beui.dev/components/motion/expanding-arrow-button"
markdown: "https://beui.dev/components/motion/expanding-arrow-button.md"
license: "MIT"
---

# Animated CTA Buttons

> Expressive call-to-action buttons with expanding, hold, and slide interactions.

## Install

### Expanding Arrow Button

An accent tile that expands into a dotted-arrow trail on hover or focus.

```bash
npx shadcn@latest add @beui/expanding-arrow-button
```

Docs: https://beui.dev/components/motion/expanding-arrow-button/expanding-arrow.md

### Hold Action Button

Hold to complete with a vertical or horizontal liquid fill; release early to cancel.

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

Docs: https://beui.dev/components/motion/expanding-arrow-button/hold-action.md

### Slide Action Button

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

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

Docs: https://beui.dev/components/motion/expanding-arrow-button/slide-action.md

## Dependencies

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

## Usage

### Expanding Arrow Button usage

An accent tile that expands into a dotted-arrow trail on hover or focus.

```tsx
"use client";

import { ExpandingArrowButton } from "@/components/motion/expanding-arrow-button";

export function ExpandingArrowButtonPreview() {
  return (
    <div className="flex items-center justify-center">
      <ExpandingArrowButton>Book a demo</ExpandingArrowButton>
    </div>
  );
}
```

### Hold Action Button usage

Hold to complete with a vertical or horizontal liquid fill; release early to cancel.

```tsx
"use client";

import { useState } from "react";
import { HoldActionButton } from "@/components/motion/hold-action-button";

export function HoldActionButtonPreview() {
  const [confirmed, setConfirmed] = useState(false);

  return (
    <div className="flex flex-col items-center justify-center gap-3">
      <HoldActionButton
        onHoldComplete={() => {
          setConfirmed(true);
          window.setTimeout(() => setConfirmed(false), 1800);
        }}
      >
        Hold for vertical fill
      </HoldActionButton>
      <HoldActionButton
        type="horizontal"
        onHoldComplete={() => {
          setConfirmed(true);
          window.setTimeout(() => setConfirmed(false), 1800);
        }}
      >
        Hold for horizontal fill
      </HoldActionButton>
      <p className="h-4 text-xs text-muted-foreground" aria-live="polite">
        {confirmed ? "Action confirmed" : "Release early to cancel"}
      </p>
    </div>
  );
}
```

### 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

### ExpandingArrowButton

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` |  | No | Classes merged onto the root element. |
| `accentClassName` | `string` |  | No | Classes merged onto the chevron pill that widens on hover or focus. |
| `labelClassName` | `string` |  | No | Classes merged onto the label text. |

### HoldActionButton

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` |  | No | Classes merged onto the root element. |
| `type` | `"horizontal" \| "vertical"` | `vertical` | No | Fill rises from the bottom or sweeps in from the left. Default: "vertical" |
| `labels` | `Partial<{ holding: string; complete: string; }>` |  | No | Override any built-in string. |
| `labelClassName` | `string` |  | No | Classes merged onto the label wrapper. |
| `holdingLabel` | `ReactNode` |  | No | Label shown while the button is held. Default: "Keep holding" |
| `completeLabel` | `ReactNode` |  | No | Label shown once the hold completes. Default: "Done" |
| `holdDuration` | `number` | `1600` | No | How long the button must be held to complete (ms). Default: 1600 |
| `onHoldComplete` | `(() => void)` |  | No | Called once when the fill finishes while still held. |
| `fillClassName` | `string` |  | No | Classes merged onto the fill layer, e.g. to change its color. |

### 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. |

## About Animated CTA Buttons

Animated CTA Buttons are three call-to-action buttons for React, each built with Framer Motion and styled with Tailwind CSS. The Expanding Arrow Button grows its accent tile across the button into a dotted arrow trail on hover or focus. The Hold Action Button fills with a liquid wave while it is held and only fires once the hold completes, so a brief tap cannot trigger it. The Slide Action Button asks the user to drag a thumb to the end of its track before it confirms, and springs back if released early.

### When to use it

- A landing page hero or pricing card needs one primary call to action that stands out from secondary links.
- A destructive or irreversible action, such as deleting a project or sending a payment, should take a deliberate hold instead of a single click.
- A mobile checkout or unlock flow wants a slide to confirm gesture that is hard to trigger by accident.

### Accessibility

All three render a real button element. The hold button responds to Space and Enter: holding either key fills it, and releasing early cancels. The slide button confirms with Enter or Space for keyboard users and announces its completed state through a polite live region. With reduced motion enabled, the arrow trail and fills appear without movement.

### FAQ

**How do I make an animated call to action button in React?**

Install the component with the shadcn CLI or copy its source, then render ExpandingArrowButton with your label as children. It accepts every standard button prop, so onClick, type and disabled work as usual.

**How long does the hold to confirm button take?**

Set the holdDuration prop in milliseconds. onHoldComplete fires once the fill reaches the end, and holdingLabel and completeLabel change the text shown while holding and after completion.

**Can I change how far the slide button has to travel?**

Yes. The threshold prop sets how far along the track the thumb must be released to confirm, and resetDelay controls when the button returns to its idle state after onComplete fires.

## Source

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