Skip to content
GitHub

Link Overlay

Makes the whole card or article clickable.

Installation

Usage

Accessibility

  • Wrapping a whole card in <a> — Screen readers announce all card content as link text (verbose, confusing).
  • LinkOverlay — Keeps the link on the heading only. Announcements stay short.
  • Full area clickable — The overlay makes the whole card clickable without extra markup.
  • Inner links — Stay above the overlay and remain focusable. Users can tab between multiple links instead of one.

The asChild prop renders another element with link overlay styling.

Examples

Article

A blog-style article with metadata, heading, description, and an inner link that stays clickable above the overlay.

By default the <LinkOverlay /> component will render an tag.

To use the Next.js (or any other) <Link /> component, make the following updates to link-overlay.tsx.

components/ui/link-overlay.tsx

API Reference

LinkOverlay