Skip to content
Mizen UI
Docs

IntroductionInstallationCLIStylingFoundationsThemingCompositionIntegrationsAccessibilityFor agents

useCopyToClipboard

AccordionAspect RatioCardCollapsibleFrameGridGroupInlineScroll AreaSectionSeparatorSpacerStack

BlockquoteCitationCodeHeadingKbdLabelLinkTextVisually Hidden

ButtonButton GroupToggleToggle groupToolbar

CalendarCheckboxCheckbox groupComboboxDate pickerDate range pickerDate-Time InputFieldFieldsetFile UploadFormInputInput groupNumber fieldOTP FieldRadio groupSelectSliderSwitchTextareaTime Input

BreadcrumbMenubarNavigation MenuPaginationSegmented ControlStepperTabs

Alert dialogCommandContext MenuDialogDrawerMenuPopoverPreview CardSheetTooltip

AlertBadgeEmptyError StateMeterProgressSkeletonSpinnerStatus dotToast

Activity FeedAvatarAvatar GroupData TableListMetricOverflow ListProperty ListTableTokenTree

Area ChartBar ListCalendar HeatmapCategory ComparisonChart FrameChart LegendChart TooltipDistributionFunnelHeatmapMetric TrendPart-to-WholeProgress RingsRadar ChartRadial BarsSankey ChartScatter ChartScore GaugeTime Series

Diagram

AttachmentCarouselCode BlockLightboxMarkdownThumbnailTimestamp

Agent ThinkingApproval CardComposerConversationInline CitationMessageMessage ScrollerQuestion CardSourcesStreaming TextSuggestionTask ListTerminalTool Call

On this page

  • Preview
  • Usage
  • Optional renderer
  • Examples
  • Sequence
  • Entity relationships
  • State transitions
  • Class
  • Pie
  • Gantt
  • Timeline
  • Changing source
  • Loading, empty, and errors
  • Recommendations
  • Usage boundaries
  • API reference

Diagrams

Diagram

Explains workflows, messages, relationships, and lifecycle transitions using Mermaid text.

idle

Usage

import { Diagram } from "@mizen-labs/ui";

Optional renderer

Install pele@^1.13.0 in the consuming app. Import from this dedicated entry point; the root Mizen import does not load the renderer. Rendering starts after hydration.

import { Diagram } from "@mizen-labs/ui/diagram";

Examples

Sequence

Trace messages between an app, agent, and tool.

Entity relationships

Describe ownership and foreign keys.

State transitions

Explain how an agent run moves between states.

Class

Show classes with their fields, methods, and associations.

Pie

Slices take the chart palette, so they match Mizen's charts.

Gantt

Plan work in sections, with done, active, and critical tasks and a milestone.

Timeline

Group events by period.

Changing source

Replace source text to render an updated workflow.

Loading, empty, and errors

Show caller-owned loading and error states, empty input, and a syntax error.

Recommendations

GuidancePractice
Do

Provide a concise aria-label and an aria-description explaining the relationships, branches, or transitions.

Do

Keep diagrams focused. Wide diagrams scroll locally rather than shrinking labels below the reading size.

Do

Use default diagram colors so nodes follow the active theme. Source style directives can override them.

Usage boundaries

GuidanceBoundary
Scope

Read-only structural diagrams. Use Charts for measurements and Task List for execution progress.

Scope

Install the optional pele peer and import Diagram from @mizen-labs/ui/diagram. Other Mizen entry points do not load the renderer.

Scope

Only flowchart, sequence, entity relationship, and state syntax are supported. Links, external images, custom icon markup, and math renderers are disabled.

API reference

Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.

PropTypeDefaultDescription
sourcestringRequiredMermaid flowchart, sequenceDiagram, erDiagram, or stateDiagram-v2 text. Empty text shows an empty state.
aria-labelstringRequiredA non-empty accessible name describing the diagram.
aria-descriptionstring—A text explanation of the relationships and decisions shown.
captionReactNode—Optional visible explanation below the diagram.
status"loading" | "ready" | "error""ready"Caller-owned data state. Loading defers the renderer; parsing errors produce separate rendering feedback.
PreviousTime SeriesNextAttachment

Rendering diagram

Rendering diagram

Rendering diagram

Each project belongs to one team. Each run belongs to one project.

Rendering diagram

Rendering diagram

Rendering diagram

Rendering diagram

Rendering diagram

Rendering diagram

Loading diagram

No diagram to show

Couldn't load this diagram

Rendering diagram