Krizaka UI
Krizaka UI
Composants

Speed lines

Manga action lines behind a hero element: a burst around it or streaks across it, drawn in SVG, deterministic and still under reduced motion.

Web · ✓Mobile · ✗ à construireBureau · ✓BêtaBlocs
import { SpeedLines } from "@krizaka/ui/speed-lines";

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

  • Mobile · ✗ à construire. It comes with the native paper roles of the Cahier. issue #421

Pourquoi il est là. The tool sites (krizaka/krizaka-ui#548): the motion lab's live demo, then the heroes of the other tool sites.

Quand l’utiliser

  • Behind the one element a page wants you to look at: a hero title, a live demo, a versus card.
  • To give an action — a launch, a release — the energy of a manga panel without moving anything.

Quand ne pas l’utiliser

Installation

Installer

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

Styles

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

Importer

import { SpeedLines } from "@krizaka/ui/speed-lines";

Exemples

Behind a hero

A radial burst behind the title that opens a page.

Across a demo

kind="horizontal" streaks behind a live demo.

Props

Manga action lines behind a hero element: a burst or streaks in SVG, still under reduced motion.

PropTypeDéfautDescription
animatedbooleanfalseA slow pulse of the lines; off under reduced motion.
clearnumber34For radial: the share of the height left clear around the centre, 0 to 80.
countnumber36How many lines (4 to 120).
kind"horizontal" | "radial"radialradial bursts from the centre; horizontal streaks across.

Accessibilité

  • The lines are decoration: the SVG is hidden from assistive technology, the content in front is the real element.
  • The lines are static; the optional pulse is removed under prefers-reduced-motion.
  • The ink is a quiet text colour at low opacity, so it never competes with the content for contrast.

Bonnes pratiques

  • One burst per screen, behind one element; the lines are quiet by design (a fraction of the text's ink).
  • Keep clear large enough that the lines never touch the text: the content is always the first thing read.
  • Use horizontal behind a live demo that moves, and radial behind a title that arrives.
  • Leave animated off unless the page needs a pulse: it stops under reduced motion anyway.

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

Sur cette page