---
title: "Hold Action Button"
description: "Free React hold to confirm button: a vertical or horizontal liquid fill rises while you hold, and releasing early cancels. Keyboard support, shadcn install."
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/hold-action"
markdown: "https://beui.dev/components/motion/expanding-arrow-button/hold-action.md"
license: "MIT"
---

# Hold Action Button

> Free React hold to confirm button: a vertical or horizontal liquid fill rises while you hold, and releasing early cancels. Keyboard support, shadcn install.

## Install

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

## Dependencies

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

## Usage

### 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>
  );
}
```

## API Reference

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

## More in Animated CTA Buttons

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

## Source

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