Animated Buttons
Buttons with hover motion, such as a fill that sweeps in or an arrow that expands behind the label.
Installation
pnpm dlx shadcn@4.18.0 add @siteplane/animated-buttonsComplete the one-time setup first. Registry JSON lists source files and dependencies.
Usage
import { FillSweepButton } from "@/siteplane/components/animated-buttons";
<FillSweepButton>Continue</FillSweepButton>;Fill variants
FillSweepButton keeps Button behavior and sweeps a fill in on hover. destructive uses the outlined destructive surface.
Expanding actions
ExpandingArrowButton expands its arrow circle behind the label on hover and can render a link. ExpandingLogoutButton shows its icon and reveals label on hover and keyboard focus; label is also its accessible name.
Sizes and states
The expanding recipes accept sm, md, lg, and xl. Disabled and loading buttons don't animate.
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
Fill | default | destructive | inverse | outline | default | Button surface; destructive renders the outlined destructive surface. |
Fill | ReactNode | unset | Visible content. |
Expanding | ReactNode | Learn more | Label; replaces children. |
Expanding | text | default | text | Surface; default sets the arrow on the default Button's fill, hairline rim and depth. |
Expanding | string | Log out | Label and default accessible name. |
Expanding | default | destructive | inverse | outline | destructive | Button surface; destructive renders the outlined destructive surface. |
Arrow / Logout. | sm | md | lg | xl | provider / lg | Control size; follows SiteplaneUIProvider when omitted. |
Arrow / Logout. | button | submit | reset | button | Native button type; not set when render supplies a link. |
Expanding | string | label | Accessible name override. |
FillSweepButtonProps extends ButtonBaseProps except variant and accepts
every Button size. ExpandingArrowButtonProps and ExpandingLogoutButtonProps
omit children, size, and variant and add label, the control size and
their own variant subset. The three Props types are exported;
AnimatedButtonVariant is not. onClick, disabled, loading, render,
style, and refs follow Button.
Usage notes
Keep actions understandable without motion. Reduced-motion behavior belongs to the built-in styles. Use actual links for navigation; leave space for expanding labels and avoid clipping them in narrow parents.