Mark Yo

Shared Layout Background

Navigation 1

About

A hover highlight for lists of links or menu rows that smoothly slides and blurs between items as the pointer moves, using a shared layout animation.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Shared Layout Background to your project and fits it to your theme.

Code

How Shared Layout Background is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { SharedLayoutBg } from "@/components/ui/shared-layout-bg";
import { ArrowUpRight } from "lucide-react";

const items = [
  { title: "Inbox", body: "12 unread threads, 3 mentions today." },
  { title: "Drafts", body: "4 posts waiting for a final pass." },
  { title: "Releases", body: "Last shipped 2 days ago, v0.4.1." },
  { title: "Billing", body: "Plan renews on the 1st of next month." },
];

export default function SharedLayoutBgDemo() {
  return (
    <div className="flex w-full h-screen items-center justify-center bg-background">
      <div className="w-full max-w-lg px-2">
        <SharedLayoutBg>
          {items.map((it) => (
            <button
              type="button"
              key={it.title}
              className="group flex flex-col gap-1 px-2 py-3 text-left"
            >
              <div className="flex items-center justify-between gap-3">
                <span className="text-sm font-medium text-foreground">
                  {it.title}
                </span>
                <ArrowUpRight className="h-3.5 w-3.5 text-muted-foreground transition-transform group-hover:translate-x-0.5 group-hover:-translate-y-0.5" />
              </div>
              <p className="text-sm text-muted-foreground">{it.body}</p>
            </button>
          ))}
        </SharedLayoutBg>
      </div>
    </div>
  );
}

Dependencies

More by Mark Yo

View all
  • Loader

    Loader

    64
  • Pricing Table

    Pricing Table

    23
  • Bento Grid

    Bento Grid

    4
  • Expandable Tabs

    Expandable Tabs

    1
  • Stateful Button

    Stateful Button

  • Animated Button

    Animated Button

  • Morphing Modal

    Morphing Modal

  • Morph Popover

    Morph Popover

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    92
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    266
  • Button Breadcrumb

    Button Breadcrumb

    36
  • Sidebar

    Sidebar

    418
  • Motion Navigation Menu

    Motion Navigation Menu

  • Astryx Breadcrumb Item

    Astryx Breadcrumb Item

    1
  • Menu

    Menu

    27
  • Progress Bar Stepper

    Progress Bar Stepper

    65