Krizaka
Documentation

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.

WebBêtaBlocs

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 usePointerLight in a component of your own that lays cards out.

Quand ne pas l’utiliser

  • Inside a CardGrid: it lights its cards already.À la place : Card grid
  • On one card alone, with a ring of the brand's gradient.À la place : Glow card

Installation

Installer

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

Styles

@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.

PropTypeDéfautDescription
targetstring[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/y in its CSS.

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

Sur cette page