Krizaka UI
Krizaka UI

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/aBureau · ✓ExpérimentalAffichage de données
Niveau de support
Expérimental
Taille
4.6 kB gzip, budget 3.5 kB
Qui l'utilise
2 fichiers des produits et sites en production l'importent Compté dans l'inventaire daté du 2026-11-23.
import { ArchitectureDiagram } from "@krizaka/ui/architecture-diagram";

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

Pourquoi il est là. 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).

Quand l’utiliser

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

Quand ne pas l’utiliser

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

Installation

Installer

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

Styles

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

Importer

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

Exemples

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.

PropTypeDéfautDescription
viewrequisArchView—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.

Accessibilité

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

Clavier

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

Bonnes pratiques

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

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