Animated Pill Button
A black pill CTA with a directional liquid wipe — cyan bursts from the right-side dot with a curved leading edge while the dot morphs into an arrow circle and the label flips contrast inside the same mask. One component scales from gallery card to fullscreen.
Installation#
pnpm dlx shadcn@latest add @davinciui/animated-pill-buttonUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
labelButton text. Duplicated internally so contrast flips exactly inside the cyan mask with zero movement. | string | "Reserve Now" |
hrefRenders a semantic link instead of a button when supplied. | string | — |
onClickClick handler. Never interfered with by the wipe animation. | () => void | — |
sizeDensity multiplier. Container queries still scale type in card and fullscreen. | "sm" | "md" | "lg" | "md" |
backgroundColorResting pill colour. Omit to auto-adapt: reference black in light mode, white in dark mode. | string | theme-aware (black / inverted white) |
activeColorExpanding wipe colour and resting dot colour. | string | "#19CBEA" |
textColorLabel colour over the resting pill. Follows the theme unless overridden. | string | theme-aware (white / inverted black) |
activeTextColorDuplicate-label colour revealed inside the cyan mask. | string | "#000000" |
disabledDisables the wipe and the click. | boolean | false |
Accessibility#
Renders a native button, or an anchor when href is supplied, so activation works normally. A focus-visible outline appears, and keyboard focus opens the wipe only after Tab; aria-label can override the visible text. Disabled removes link behavior.
Motion#
Hover or focus expands a circular cyan fill over 620ms, masks a duplicate label, and morphs the dot into an arrow; a scroll entrance also plays. No timing props are exposed. CSS and JS both honor prefers-reduced-motion by removing the wipe.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

