Krizaka
Documentation

Scroll stage

The conductor of a told page: chapters (Scene) that play their entrance once, in order, as they scroll into view — the visual, then the announcement, then the words — with one slow loop each, running only while on screen.

WebBêtaMise en page

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

Quand l’utiliser

  • A page that tells a story in chapters: an about page, a product tour, a launch, a year in review.
  • An onboarding or a long landing page whose sections should arrive one at a time, at reading speed.
  • To give a whole page the arcade flavour of the storytelling kit at once (variant="arcade").

Quand ne pas l’utiliser

  • Ordinary pages: blocks that simply fade in as they enter.À la place : Page
  • Working screens (a dashboard, a form, a table): nothing there should wait to appear.

Installation

Installer

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

Styles

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

Importer

import { ScrollStage, Scene } from "@krizaka/ui/scroll-stage";

Exemples

Chapters

Two chapters of an onboarding: each one's banner, then its words, then its gauge — once, as they scroll in.

Step 01Your profile

Say who you are, in your words

Three questions, two photos. Nothing is public until you say so.

Step 02Your first goal

Arcade flavour

variant="arcade" once on the stage: a final round, the boss gauge draining.

Final round

Eight problems in the way

One by one, they fall.

Props

Scene

A chapter of a ScrollStage: played once when it enters the viewport, its loop running while it is visible.

PropTypeDéfautDescription
as"footer" | "header" | "li" | PolymorphicsectionThe element the scene renders.
brandstring—A brand scope for the scene (orochia → .brand-orochia): its accent and gradient become that brand's.

ScrollStage

Plays the scenes (Scene, or any [data-kzs-scene]) it contains: each one gets data-in once, when it first enters the viewport — its parts then arrive in order (the visual, the announcement, the words: data-kzs-reveal) — and data-live while it is visible, which runs its one loop. Until the stage has switched motion on, and under prefers-reduced-motion, everything is visible and still.

PropTypeDéfautDescription
asPolymorphicdivThe element the stage renders.
thresholdnumber0.2How much of a scene must be visible before it plays (0–1).
variantStoryVariantdefaultThe look of every storytelling component inside (each one can still set its own): default or arcade.

Accessibilité

  • Under prefers-reduced-motion the stage never switches motion on: everything is visible and still.
  • Nothing is hidden from assistive technology or from a page without JavaScript: content is only held invisible once the stage is on, until its scene enters.
  • Each scene has at most one loop, slow and faint, paused off screen and never behind a paragraph.

Bonnes pratiques

  • One ScrollStage per page, around the chapters; one Scene per chapter (a section by default).
  • Mark the words of a chapter with data-kzs-reveal: they arrive after its visual and its banner (--kzs-delay to change when).
  • Keep the first screen out of any scene's entrance: what the reader sees on arrival is painted at once.
  • Import the kit's styles once: import "@krizaka/ui/story.css".

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

Sur cette page