Skip to content

Underline Link

Text link with a line that draws in from the left and leaves to the right.

From the Nitip template — see it in context

Installation

$ npx shadcn@latest add https://framebrick.co/r/underline-link.json

Usage

import { UnderlineLink } from "@/components/ui/underline-link";

<UnderlineLink href="/projects">All projects</UnderlineLink>

Props

PropTypeDefaultDescription
hrefstring—Link target. http(s) links open in a new tab.
arrowbooleantrueShow the arrow that turns from ↘ to → on hover.
thickness1 | 21Line thickness in px.
…propsanchor props—Passed to the link.
  • The line also draws in on keyboard focus.

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 UnderlineLink using Next.js Link.
- Inline-flex, text-sm font-medium text-foreground (shadcn defaults), 2px bottom padding.
- An absolutely positioned line at the bottom (1px or 2px, bg-current). At rest scaleX 0; on hover scaleX 1.
  Grow from the left (transform-origin left) and shrink out to the right (transform-origin right) — switch the origin instantly.
- Optional down-right arrow after the label that rotates -45° on hover so it points right.
- Spring for both: bounce 0.2, duration 0.4s. The same animation runs on keyboard focus.
- External http(s) links open in a new tab with rel noopener noreferrer. Colors from the theme (text-foreground).

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