Article Element
This LinkBox renders as an article element.
LinkOverlay and LinkBox components are used to make entire card areas clickable while preserving the ability to have nested interactive elements like links and buttons.
import { LinkOverlay } from "@ninna-ui/primitives"pnpm add @ninna-ui/primitivesRequires @ninna-ui/core (auto-installed) + CSS setup.
Use LinkBox as a container and LinkOverlay to make the entire area clickable.
import { LinkOverlay, LinkBox, Heading, Text } from "@ninna-ui/primitives";
export default function Example() { return ( <LinkBox className="p-4 border rounded-lg"> <Heading as="h3"> <LinkOverlay href="/article"> Article Title </LinkOverlay> </Heading> <Text>Article description...</Text> </LinkBox> );}A simple clickable card using LinkBox and LinkOverlay.
The entire card is clickable because of LinkOverlay.
Use relative z-10 class on nested links to make them clickable above the overlay.
LinkBox can render as different semantic HTML elements.
This LinkBox renders as an article element.
This LinkBox renders as a section element.
LinkOverlay supports external links with proper security attributes.
This card opens an external link in a new tab.
Real-world examples of LinkOverlay component usage.
5 min read
Learn how to create accessible and reusable UI components using modern React patterns.
• Jan 15, 2024
Complete list of props for LinkBox and LinkOverlay components.
| Prop | Type | Default | Description |
|---|---|---|---|
as | 'div' | 'article' | 'section' | 'aside' | 'header' | 'footer' | 'main' | 'nav' | 'div' | The HTML element to render as |
className | string | - | Additional CSS classes |
| Prop | Type | Default | Description |
|---|---|---|---|
href | string | - | The URL the link points to |
external | boolean | false | Whether the link opens in a new tab |
className | string | - | Additional CSS classes |