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.
- Domaine
- Cahier (registre des sites)
- Niveau de support
- 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
- How a system is built: its containers and their relations.À la place : Architecture diagram
- A real capture of a product screen.À la place : Taped photo
Installation
Installer
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@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.
| Prop | Type | Défaut | Description |
|---|---|---|---|
specrequis | SketchSpec | — | The drawing. |
titlerequis | string | — | What the drawing shows, in one sentence: the drawing's accessible name. |
caption | ReactNode | — | The caption under the figure: Fig. 2 — the booking page. |
legend | readonly 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.
| Prop | Type | Défaut | Description |
|---|---|---|---|
afterrequis | SketchProps | — | The sketch after the change. |
afterLabelrequis | ReactNode | — | The note above the second sketch: after. |
beforerequis | SketchProps | — | The sketch before the change. |
beforeLabelrequis | ReactNode | — | The note above the first sketch: before. |
Accessibilité
- The drawing is one image (
role="img") named bytitle(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
iconshape must name an@krizaka/iconsglyph: an unknown name throwsSketchIconErrorrather 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
seedonce 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 withframe: "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.
Composants liés
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