Skip to content

Spring Button

Button whose arrow turns on hover, with a soft lift and a press spring.

From the Nitip template — see it in context

Installation

$ npx shadcn@latest add https://framebrick.co/r/spring-button.json

Usage

import { SpringButton } from "@/components/ui/spring-button";

<SpringButton href="/contact">Get started</SpringButton>
<SpringButton variant="outline" onClick={save}>Save</SpringButton>

Props

PropTypeDefaultDescription
variant"default" | "secondary" | "outline" | "ghost""default"shadcn button styles. Default and secondary lift with a shadow on hover.
size"sm" | "default" | "lg""default"Height 32 / 36 / 40 px, like the shadcn button.
arrowbooleantrueShow the arrow that turns 45° on hover.
hrefstring—Render a Next.js link instead of a button. http(s) links open in a new tab.
…propsbutton / anchor props—Passed to the element (onClick, disabled, aria-*, Motion props).

AI prompt

Paste into v0, Lovable, Bolt or Claude to rebuild this component in your own project.

Create a React + Tailwind CSS + Motion (motion/react) component called SpringButton.
- Look exactly like the shadcn/ui Button: rounded-md, text-sm font-medium, variants default / secondary / outline / ghost,
  sizes sm (h-8 px-3), default (h-9 px-4), lg (h-10 px-6), focus ring ring-[3px] ring-ring/50.
- A 16px up-right arrow icon after the label. On hover it rotates 45° so it points right, with a spring (bounce 0.2, duration 0.4s).
- Default and secondary variants: on hover a soft layered shadow fades in (animate box-shadow from the same layers at 0 alpha).
- On press scale to 0.97 with the same spring.
- If an href prop is given render a Next.js Link (motion.create(Link)); external http(s) links get target _blank and rel noopener.
- Use only the shadcn CSS variables (primary, secondary, accent, border, input, ring) so it follows the theme.

Be the first to know

Get new templates and components first

One short email when we release a template or a free component. No spam — unsubscribe anytime.

We use your email only for Framebrick updates. Privacy policy