Logo wall
The tools you work with, in one tray instead of a marquee. They swell toward the pointer like a dock, and the one you point at rises and says, in one line, how it fits.
npx shadcn@latest add https://captain-ui.vercel.app/r/logo-wall.jsonWorks with the stack you have
Next.js. Each component starts with "use client", so it drops into App Router pages and Server Component trees as it is.
"use client";
// Captain UI · Logo wall, MIT. The tools you work with sit in one tray; they swell toward the pointer like a dock, and the one you point at rises and says how it fits.
import { AnimatePresence, motion, useMotionValue, useReducedMotion, useSpring, useTransform, type MotionValue } from "motion/react";
import { useId, useRef, useState, type ReactNode } from "react";
import { EASE, SPRING_LAYOUT, cx } from "@/registry/captain/ui/captain";
export type WallLogo = { name: string; mark: ReactNode; line: ReactNode; href?: string };
type LogoWallProps = {
logos: WallLogo[];
heading?: ReactNode;
defaultIndex?: number;
className?: string;
};
const REACH = 150; // px within which the pointer swells a logo
export function LogoWall({ logos, heading, defaultIndex = 0, className }: LogoWallProps) {
const [active, setActive] = useState(defaultIndex);
const mx = useMotionValue(-1e4);
const my = useMotionValue(-1e4);
const reduce = useReducedMotion();
const id = useId();
const a = logos[active];
return (
<section className={cx("w-full", className)} aria-labelledby={heading ? `${id}-h` : undefined}>
{heading ? (
<h2 id={`${id}-h`} className="mb-5 text-[22px] font-medium tracking-[-0.015em] text-ink">
{heading}
</h2>
) : null}
<ul
className="well grid grid-cols-2 gap-1 rounded-shell p-2 sm:grid-cols-3"
onPointerMove={(e) => {
if (e.pointerType !== "mouse" || reduce) return;
mx.set(e.clientX);
my.set(e.clientY);
}}
onPointerLeave={() => {
mx.set(-1e4);
my.set(-1e4);
}}
>
{logos.map((l, i) => (
<Key key={l.name} logo={l} on={i === active} mx={mx} my={my} group={id} onActivate={() => setActive(i)} reduce={!!reduce} />
))}
</ul>
<div className="relative mt-4 min-h-[3.2em] overflow-hidden px-1" aria-live="polite">
<AnimatePresence initial={false} mode="popLayout">
{a ? (
<motion.p
key={a.name}
initial={{ opacity: 0, y: reduce ? 0 : 8 }}
animate={{ opacity: 1, y: 0 }}
exit={{ opacity: 0, y: reduce ? 0 : -8 }}
transition={{ duration: 0.2, ease: EASE }}
className="text-[14px] leading-relaxed text-ink-2"
>
<span className="font-medium text-ink">{a.name}.</span> {a.line}
</motion.p>
) : null}
</AnimatePresence>
</div>
</section>
);
}
function Key({
logo,
on,
mx,
my,
group,
onActivate,
reduce,
}: {
logo: WallLogo;
on: boolean;
mx: MotionValue<number>;
my: MotionValue<number>;
group: string;
onActivate: () => void;
reduce: boolean;
}) {
const el = useRef<HTMLLIElement>(null);
const near = useTransform([mx, my], ([x = 0, y = 0]: number[]) => {
const r = el.current?.getBoundingClientRect();
if (!r) return 0;
const d = Math.hypot(x - (r.left + r.width / 2), (y - (r.top + r.height / 2)) * 1.6);
return Math.max(0, 1 - d / REACH);
});
const scale = useSpring(useTransform(near, (n) => 1 + n * 0.14), { stiffness: 420, damping: 32 });
const Tag = logo.href ? "a" : "button";
return (
<li ref={el} className="relative flex justify-center">
{on ? <motion.span layoutId={`${group}-key`} aria-hidden className="raised absolute inset-0 rounded-inner" transition={reduce ? { duration: 0 } : SPRING_LAYOUT} /> : null}
<Tag
{...(logo.href ? { href: logo.href } : { type: "button" as const })}
aria-pressed={logo.href ? undefined : on}
onPointerEnter={onActivate}
onFocus={onActivate}
onClick={onActivate}
className={cx(
"relative flex h-14 w-full items-center justify-center rounded-inner px-3 transition-colors duration-200 focus-visible:bg-accent-tint",
on ? "text-ink" : "text-ink-3 hover:text-ink-2",
)}
>
<motion.span className="flex items-center gap-2.5" style={{ scale: reduce ? 1 : scale }}>
<span className="grid size-[22px] place-items-center">{logo.mark}</span>
<span className="text-[13.5px] font-medium tracking-[-0.01em] whitespace-nowrap sm:text-[15px]">{logo.name}</span>
</motion.span>
</Tag>
</li>
);
}
/* Monochrome marks, drawn on a 24 grid in currentColor. Simplified for small sizes; they name the tools, they do not claim them as customers. */
const S = { fill: "none", stroke: "currentColor", strokeWidth: 1.6, strokeLinecap: "round", strokeLinejoin: "round" } as const;
export const MARKS = {
next: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<circle cx="12" cy="12" r="9.5" {...S} />
<path d="M9 16.5v-9l7.2 10.1M15 7.5v5.5" {...S} />
</svg>
),
react: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<ellipse cx="12" cy="12" rx="10" ry="3.9" {...S} />
<ellipse cx="12" cy="12" rx="10" ry="3.9" transform="rotate(60 12 12)" {...S} />
<ellipse cx="12" cy="12" rx="10" ry="3.9" transform="rotate(120 12 12)" {...S} />
<circle cx="12" cy="12" r="1.7" fill="currentColor" />
</svg>
),
tailwind: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<path
fill="currentColor"
d="M12 6c-2.67 0-4.33 1.33-5 4 1-1.33 2.17-1.83 3.5-1.5.76.19 1.31.74 1.91 1.35.98 1 2.11 2.15 4.59 2.15 2.67 0 4.33-1.33 5-4-1 1.33-2.17 1.83-3.5 1.5-.76-.19-1.31-.74-1.91-1.35C15.61 7.15 14.48 6 12 6Zm-5 6c-2.67 0-4.33 1.33-5 4 1-1.33 2.17-1.83 3.5-1.5.76.19 1.31.74 1.91 1.35.98 1 2.11 2.15 4.59 2.15 2.67 0 4.33-1.33 5-4-1 1.33-2.17 1.83-3.5 1.5-.76-.19-1.31-.74-1.91-1.35C10.61 13.15 9.48 12 7 12Z"
/>
</svg>
),
shadcn: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<path d="M19.5 12.5 12.5 19.5M18.5 4.5l-14 14" {...S} strokeWidth={2} />
</svg>
),
vite: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<path d="M21 4.5 12 20.5 3 4.5" {...S} />
<path d="M13.4 3 9 11.2h3.3l-1 6.3 4.6-8.4h-3.2Z" fill="currentColor" />
</svg>
),
vercel: (
<svg viewBox="0 0 24 24" width="22" height="22" aria-hidden>
<path d="M12 4 21 19.5H3Z" fill="currentColor" />
</svg>
),
};Usage
import { LogoWall, MARKS } from "@/components/ui/logo-wall"
<LogoWall
heading="Works with the stack you have"
logos={[{ name: "Next.js", mark: MARKS.next, line: "Drops into App Router pages as it is." }]}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| logos | { name: string; mark: ReactNode; line: ReactNode; href?: string }[] | Each tool, its mark and the one line said when it is raised. | |
| heading | ReactNode | The section's heading. | |
| defaultIndex | number | 0 | The logo raised before anyone points. |
| MARKS | export | Monochrome marks for Next.js, React, Tailwind CSS, shadcn/ui, Vite and Vercel, in currentColor. |
Keyboard
- Tab
- Move between logos; focus raises one
- Enter / Space
- Raise it, or follow its link
Accessibility
- Each logo is a button (or a link with href) named by its text, with aria-pressed on the raised one.
- The line under the tray is a polite live region, so focusing a logo reads how it fits.
- The dock swell is pointer-only and off under reduced motion; touch taps raise a logo.