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.

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

From the Kalme template, see it in context.

Examples

Slides sideways

The arrow leaves to the right while a second one arrives from the left.

<ArrowFlipLink href="/about" direction="right">Learn more</ArrowFlipLink>
<ArrowFlipLink href="/reviews" direction="right" circle={false}>View all reviews</ArrowFlipLink>

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 (the space it takes, with or without the circle).
direction"diagonal" | "right""diagonal"Diagonal: the arrow leaves at the top right and a second one arrives from the bottom left. Right: it slides out to the right and a second one comes in from the left (Semono).
circlebooleantrueThe filled circle behind the arrow. Without it the arrow is alone, in the text colour, in the same space.
revealbooleanfalseHide the arrow at rest; it slides in on hover or focus (Semono's footer rows). Either direction.
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.
  • direction="right" keeps two arrows 10 px apart in a window one arrow wide and moves the pair by one arrow plus 10 px (22 px for the default 18 px circle). For a footer row give the link `className="w-full justify-between"` with circle={false} and reveal.

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.
- Options: direction "right" swaps the diagonal grid for a row of two right arrows 10px apart in the same window, anchored to
  the right edge, which moves x: 0 → (arrow + 10px) on hover and focus, so the one waiting on the left takes the window and the
  one in it leaves to the right. circle={false} drops the filled circle and its colours (the arrow takes currentColor) and keeps
  the space. reveal makes the arrow that is in the window at rest opacity-0, so nothing shows until hover.

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