Pointer light
The light that follows the pointer over a group of cards: one passive listener writes the pointer's position into the card it is over, the card's CSS draws the light.
Web uniquement — React, depuis @krizaka/ui/pointer-light. Bêta : son API peut encore changer à une version mineure.
Quand l’utiliser
- Inside a group of cards that is not a
CardGrid(a flex row, a list, a carousel). - With
usePointerLightin a component of your own that lays cards out.
Quand ne pas l’utiliser
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Importer
import { PointerLight, usePointerLight } from "@krizaka/ui/pointer-light";Exemples
A row of cards
Two link cards in a flex row, lit by the pointer.
Props
Drop it inside any group of cards (a grid, a list) — it listens on its parent element. Renders an empty, hidden span. CardGrid includes it already.
| Prop | Type | Défaut | Description |
|---|---|---|---|
target | string | [data-kz-light] | The cards to light, as a selector inside the parent element. |
Accessibilité
- Purely decorative: it renders a hidden, empty element and adds nothing to the accessibility tree.
- Nothing runs on touch screens or under
prefers-reduced-motion; nothing loops.
Bonnes pratiques
- One light per group: drop it once, as the last child of the group.
- The cards of the blocks carry
data-kz-light; a card of your own adds it and draws--kz-pointer-x/yin its CSS.
Composants liés
Générée depuis le code de @krizaka/ui 2.8.0 : son meta.ts, ses exemples et ses types.Modifier cette documentation sur GitHub
Page hero
The first screen of a page: the way back, an eyebrow, the h1, a lead, what follows them (facts, actions) and an aside (the page's bird) — on the brand's backdrop, painted at once.
Table of contents
The sections of a reading page: sticky beside the content on a wide screen, a row of chips that scrolls sideways on a phone, the section being read marked — with TocLayout to place it.