Skip to content

Arrow Flip Link

Text link whose round arrow leaves at the top right as a second one arrives from the bottom left.

From the Kalme template — see it in context

Installation

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

Usage

import { ArrowFlipLink } from "@/components/ui/arrow-flip-link";

<ArrowFlipLink href="/work">All projects</ArrowFlipLink>

// tinted like the template, through the root's group
<ArrowFlipLink href="/work" className="group-hover:text-destructive" circleClassName="group-hover:bg-destructive">
  Read the case study
</ArrowFlipLink>

Props

PropTypeDefaultDescription
hrefstring—Link target. http(s) links open in a new tab.
sizenumber18Diameter of the round arrow, in px.
circleClassNamestring—Classes for the circle — this is where a hover tint goes.
…propsanchor props—Passed to the link.
  • The flip also runs on keyboard focus.
  • Colour is yours: the root is a `group`, so `group-hover:` classes on the label and the circle tint it. Kalme turns both red; what this component carries is the motion.
  • The arrows are decorative, so they are hidden from screen readers — the label does the talking.

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 ArrowFlipLink using Next.js Link.
- A link: label (text-sm font-medium) and, after it, a round filled circle (default 18px, bg-primary,
  text-primary-foreground) holding an up-right arrow.
- Inside the circle, a box the size of the arrow with overflow-hidden holds a 2x2 grid twice that size, with arrows in
  the top-right and bottom-left cells. At rest the grid sits at x: -box, y: 0 (showing the bottom-left arrow's cell);
  on hover it moves to x: 0, y: -box, so the visible arrow leaves towards the top right while the second arrives from
  the bottom left. Spring, bounce 0, duration 0.4s, also on keyboard focus.
- Leave colour to the caller: give the root the `group` class and take a circleClassName, so a tint is
  `group-hover:text-…` and `group-hover:bg-…`.
- External http(s) links open in a new tab with rel noopener noreferrer; the arrows are aria-hidden.

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