Krizaka UI
Krizaka UI
ComponentsData display

Architecture diagram

One laid-out C4 view (context, containers, components or a dynamic flow) drawn on the plate in the page's tokens — groups, elements by shape, labelled edges, numbered steps — with its full text version.

Web · ✓Mobile · n/aDesktop · ✓ExperimentalData display
Support level
Experimental
Size
4.6 kB gzip, budget 3.5 kB
Who uses it
2 files of the live products and sites import it Counted in the dated inventory of 2026-11-23.
import { ArchitectureDiagram } from "@krizaka/ui/architecture-diagram";

Web only — React, from @krizaka/ui/architecture-diagram. 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 screen lists the same elements and relations. → List

Why it is here. krizaka-blog draws its C4 views with it and drops its own renderer (krizaka/krizaka-blog#340); then the docs sites of @krizaka/docs and the cockpit (krizaka-internal#3672).

When to use

  • A post or a docs page that shows how a system is built: its context, its containers, its components.
  • A dynamic view: the numbered steps of one flow (a request, a release, a pull request's life).
  • A cockpit page that shows the architecture the code was checked against.

When not to use

  • An engine and the apps it serves, with what travels between them, on a landing.Use instead: Engine flow
  • A sequence of steps a person goes through.Use instead: Stepper
  • Facts about one element.Use instead: Description list

Installation

Install

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

Styles

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

Import

import { ArchitectureDiagram } from "@krizaka/ui/architecture-diagram";

Examples

Context

Who uses the system and what it relies on outside: a person, a browser, an external store.

Containers

The system as a group, its containers inside, a database below.

Dynamic flow

dynamic: true: the edges are numbered steps, and the text version lists them in order.

Props

One laid-out C4 view (context, containers, components, or a dynamic flow) drawn on the plate: groups, elements by shape, edges with their labels and, in a dynamic view, numbered steps. The full text version follows it.

PropTypeDefaultDescription
viewrequiredArchView—One laid-out view, as @krizaka/architecture emits it: the component draws it and lays out nothing.
linksReadonly<Record<string, string>>—Links of the elements, by node id: each title of the text version becomes a link. Only http:/https: addresses and same-site paths are kept (safeHref); any other is dropped and the title stays plain text.
subtitleReactNode—One line beside the title: the view's scope, its source.
textOpenbooleanfalseOpens the text version from the start (a page where the words are the main reading).
titlestringview.titleThe figure's title, shown above the drawing and read as the image's name.
wordsPartial<ArchitectureDiagramWords>—The words of the text version.

Accessibility

  • The drawing is one image (role="img") named by the view's title (aria-label); its text version is a <details> built from the same view: the elements (nested in their groups), then the relations or, in a dynamic view, the ordered steps.
  • Every label is a text child, never markup: a hostile title renders as its characters.
  • A link is only an http:/https: address, a same-site path or an anchor (safeHref); any other scheme is dropped.
  • On a phone the drawing keeps a legible size and scrolls in its frame, which takes the keyboard focus; the text version is the phone reading.

Keyboard

KeysAction
Arrow keysScroll the drawing in its frame (once the frame has focus) when it is wider than the screen.

Best practices

  • Pass the view @krizaka/architecture laid out, unchanged: the component draws, it never lays out, so the drawing is the model's.
  • One view per figure, under its view title; the subtitle says the level (C4 · level 2) or the source.
  • Pass links by element id for the elements that have a page: they become links in the text version.
  • Pass words in the page's language: the text version's headings are props.

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