Card Link
A whole card that is a single link: the click target is the card, not a button inside it.
Live demo
Card Link is a Card that navigates. It renders one <a> carrying the card's surface, padding, and slots, so the entire card is the click target instead of a link buried in it.
It composes the same interactive, overlay, and compact looks as Card, defaults to interactive (a link card invites the click), and resets the underline and ink so the card reads as a card, not a hyperlink. Pass href (plus optional target/rel); a keyboard focus-visible ring lands on the card itself. Reach for it wherever a card is a destination: a pager, a nav grid, a list of entries.
When to use
How this component composes with the rest of the set.
Props
6 props, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Appearance
States
focus-visible
Keyboard focus on the card: a token ring plus a transparent outline that becomes real in forced-colors mode.
Anatomy
The named parts that make up the component, with their selectors.
card-link
The anchor root carrying the card classes plus the link reset.
focus
The keyboard focus ring on the card itself.
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xoji-default register
(derive(xojiDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--border-normal
--border-thick
--ring
Slots
The card body.
An optional header row, set off from the body.
An optional footer row, ruled off below the body.
Accessibility
Code
A card that navigates
The whole card is one link, with the interactive lift on hover and a header and footer.
<xoji-card-link href="/components/button" interactive>
<strong slot="header">Button</strong>
The thing people click — variants, tones, and sizes.
<span slot="footer">View component →</span>
</xoji-card-link>
<script lang="ts">
import { CardLink } from "@xoji/svelte";
</script>
<CardLink href="/components/button" interactive>
{#snippet header()}<strong>Button</strong>{/snippet}
The thing people click — variants, tones, and sizes.
{#snippet footer()}<span>View component →</span>{/snippet}
</CardLink>
---
import { CardLink } from "@xoji/astro";
---
<CardLink href="/components/button" interactive>
<strong slot="header">Button</strong>
The thing people click — variants, tones, and sizes.
<span slot="footer">View component →</span>
</CardLink>