Krizaka UI
Krizaka UI

Sketch

A screen drawn as with a pen in a school notebook — boxes, buttons, scribbled lines, icons, hatched areas — with numbered callouts in the margin red and a legend in real text that says what each item is for.

Web · ✓Mobile · n/aBureau · ✓ExpérimentalBlocs
Niveau de support
Expérimental
Taille
4.0 kB gzip, budget 3.0 kB
Qui l'utilise
15 fichiers des produits et sites en production l'importent Compté dans l'inventaire daté du 2026-11-23.
import { Sketch, SketchPair } from "@krizaka/ui/sketch";

Web uniquement — React, depuis @krizaka/ui/sketch. Expérimental : créé pour un besoin déposé, il peut changer ou disparaître à toute version mineure, jusqu'à ce qu'une première app l'utilise.

  • Mobile · n/a. A figure of a reading page (a post, a docs site); an app shows its real screen, never a drawing of it.

Pourquoi il est là. krizaka-blog explains its UI pieces with pen-on-notebook drawings in chapters 34 and 35 (krizaka-internal#3943, #4000); then krizaka.com and the docs sites (krizaka-internal#4006).

Quand l’utiliser

  • A post or a docs page that explains what each part of a screen is for, without a real capture.
  • A before / after of a redesign, drawn at the same scale (SketchPair).
  • A screen that holds personal data: the sensitive area is hatched, never shown.

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 { Sketch, SketchPair } from "@krizaka/ui/sketch";

Exemples

A desktop screen

A booking page in a plain frame: four callouts, the legend under it.

A phone screen

frame: "phone": the phone's outline, arrows from the margin to the items.

Before and after

SketchPair: two sketches side by side from 48rem, one above the other below.

A hatched area

kind: "hatch": the customer's details are hatched, never drawn.

Props

Sketch

A screen drawn as with a pen in a notebook: boxes, buttons, scribbled lines, a few words, icons, hatched areas and numbered callouts, then the legend that says what each number is for. Server-rendered, no client JavaScript.

PropTypeDéfautDescription
specrequisSketchSpec—The drawing.
titlerequisstring—What the drawing shows, in one sentence: the drawing's accessible name.
captionReactNode—The caption under the figure: Fig. 2 — the booking page.
legendreadonly SketchLegendItem[][]One line per callout number, in reading order: every number has a line, every line a number.

SketchPair

Two sketches, before and after a change: side by side from 48rem of room, one above the other below.

PropTypeDéfautDescription
afterrequisSketchProps—The sketch after the change.
afterLabelrequisReactNode—The note above the second sketch: after.
beforerequisSketchProps—The sketch before the change.
beforeLabelrequisReactNode—The note above the first sketch: before.

Accessibilité

  • The drawing is one image (role="img") named by title (also its SVG <title>); its strokes and words are not read one by one.
  • The legend is an ordered list whose numbers follow the callouts (value): it is the text version of the drawing.
  • Strokes, washes and numbers are tokens (--kz-text-primary, --kz-accent, --kz-paper-rule-margin): the drawing follows the theme, paper and slate.
  • An icon shape must name an @krizaka/icons glyph: an unknown name throws SketchIconError rather than draw a blank.

Bonnes pratiques

  • Only numbers and very short words inside the drawing: on a phone it shrinks, the legend does not. The meaning lives in the legend.
  • One legend line per callout number, and the reverse: the component warns in development when they do not pair.
  • Keep the seed once the drawing looks right: the same spec and seed always draw the same SVG.
  • Draw a phone with frame: "phone" and a width of about 390, a desktop with frame: "desktop" and about 1200: the callouts keep a legible size.
  • Hatch what is personal or secret (kind: "hatch"): a sketch never shows a real name, an address or a number.

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

Sur cette page