Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Animated CTA Buttons

Hold Action Button

HoldActionButton.vue

Release early to cancel

Install

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/hold-action-button

Import the shared styles once in your application.

TSUsage
import HoldActionButton from '@/components/beui/actions/HoldActionButton.vue'
import '@/components/beui/styles.css'

API Reference

type?
"vertical" | "horizontal"

Fill direction: bottom-up, or left-to-right.

Defaultvertical
className?
string
Default—
labels?
Partial<HoldActionButtonMessages>

Override any built-in string.

Default—
labelClassName?
string
Default—
holdingLabel?
string
Default—
completeLabel?
string
Default—
holdDuration?
number

How long the fill takes to cross the button, in ms.

Default1600
@hold-complete?
() => void
Default—
fillClassName?
string
Default—
direction?
"vertical" | "horizontal"

Alias kept for the existing Vue demos and docs: `horizontal` fills left-to-right.

Default—
disabled?
boolean
Default—
#default?
slot

Resting label. A plain string also names the button for assistive technology.

Default—
#holdingLabel?
slot

Replaces the \"holding\" text; wins over the `holdingLabel` prop.

Default—
#completeLabel?
slot

Replaces the \"complete\" text; wins over the `completeLabel` prop.

Default—

Updated