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.
- Domain
- Cahier (sites register)
- Support level
- Size
- 4.0 kB gzip, budget 3.0 kB
- Who uses it
- 15 files of the live products and sites import it Counted in the dated inventory of 2026-11-23.
import { Sketch, SketchPair } from "@krizaka/ui/sketch";Web only — React, from @krizaka/ui/sketch. Experimental: created for a filed need, it may change or go in any minor version, until its first app uses it.
- 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.
Why it is here. 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).
When to use
- 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.
When not to use
- How a system is built: its containers and their relations.Use instead: Architecture diagram
- A real capture of a product screen.Use instead: Taped photo
Installation
Install
npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcssStyles
@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";Import
import { Sketch, SketchPair } from "@krizaka/ui/sketch";Examples
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 | Default | Description |
|---|---|---|---|
specrequired | SketchSpec | — | The drawing. |
titlerequired | 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 | Default | Description |
|---|---|---|---|
afterrequired | SketchProps | — | The sketch after the change. |
afterLabelrequired | ReactNode | — | The note above the second sketch: after. |
beforerequired | SketchProps | — | The sketch before the change. |
beforeLabelrequired | ReactNode | — | The note above the first sketch: before. |
Accessibility
- 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.
Best practices
- 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.
Related components
Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub