Krizaka
Documentation

Link card

An entry point where the whole card is one link: an icon tile, a title, one sentence and the way in — compact, the same on every page, lifting and lighting under the pointer or the focus.

WebBêtaBlocs

Web uniquement — React, depuis @krizaka/ui/link-card. Bêta : son API peut encore changer à une version mineure.

Quand l’utiliser

  • The entry points of a hub: a documentation's sections, the products, the next steps of a guide.
  • Any link that deserves more than its words: what the reader finds there, in one sentence.

Quand ne pas l’utiliser

  • When the card holds several actions: a card that is a link holds no other link.À la place : Argument card
  • For a link inside a sentence or a list of plain links.À la place : Chip link

Installation

Installer

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Importer

import { LinkCard } from "@krizaka/ui/link-card";

Exemples

A documentation hub

Three compact cards in a grid: a mark, a title, a sentence, Open.

Stacked, with facts

layout="stack", a category above the title and facts under the text.

An external link

An absolute address: a new tab and the external mark.

Props

An entry point: the whole card is one link — icon, title, sentence, the way in. Lifts and lights under the pointer.

PropTypeDéfautDescription
hrefrequisstring—Where the card leads. An absolute URL opens in a new tab, with the external mark.
titlerequisReactNode—The title: the name of the destination.
ctaReactNode—The way in, under the text, with an arrow: Open, Read the guide.
descriptionReactNode—One sentence: what the reader finds there.
extraReactNode—Under the text, before the way in: facts (Facts), badges. Never another link — the card is one.
iconReactNode—The icon tile on the left (a product mark, a signature icon): decorative, the title names the link.
layout"row" | "stack"rowrow: the icon beside the text (compact, the default); stack: the icon above it.
linkAsLinkComponent—The app's link component for internal addresses (Next's Link); an <a> otherwise.
metaReactNode—A short mono line above the title (a category, a version).
titleAs"h2" | "h3" | "h4" | "span"h3The title's element: a heading when the cards are the content of a section (a hub), span inside a list of links.

Accessibilité

  • The card is a single link: its accessible name is its whole text — keep it short.
  • An absolute address opens in a new tab with rel="noopener noreferrer" and the external mark.
  • The icon and the arrow are decorative; the lift and the light stop under prefers-reduced-motion.

Clavier

TouchesAction
TabFocuses the card, which lights and draws the focus ring like the pointer does.

Bonnes pratiques

  • One sentence of description; the title names the destination, the way in (cta) says the action.
  • Use the product's mark or a signature icon as icon, never a placeholder.
  • Pass the app's router link as linkAs (Next's Link) so internal links prefetch.
  • In a hub, keep the default h3 titles under the section's h2; in a list of links, titleAs="span".

Générée depuis le code de @krizaka/ui 2.9.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub

Sur cette page