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/aDesktop · ✓ExperimentalBlocks
Support level
Experimental
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

Installation

Install

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

Styles

@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.

PropTypeDefaultDescription
specrequiredSketchSpec—The drawing.
titlerequiredstring—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.

PropTypeDefaultDescription
afterrequiredSketchProps—The sketch after the change.
afterLabelrequiredReactNode—The note above the second sketch: after.
beforerequiredSketchProps—The sketch before the change.
beforeLabelrequiredReactNode—The note above the first sketch: before.

Accessibility

  • 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.

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 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.

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page