artifacts.space/Docs
Sign in

Get started

  • Introduction
  • Quickstart
  • Client setup

Reference

  • MCP reference
  • Formats
  • Themes

Work together

  • Sharing, teams, and agents

Run it

  • Limits and quotas
  • Self-hosting

Earlier formats

  • JSON Render
  • Components

    Layout

    • Section
    • Stack
    • Grid
    • Card
    • Tabs
    • Accordion
    • Separator
    • Box

    Content

    • Heading
    • Text
    • Markdown
    • Code
    • Callout
    • Badge
    • List
    • Steps
    • Link
    • Quote
    • Icon
    • Avatar
    • AvatarGroup
    • Kbd
    • Rating

    Data

    • Table
    • Metric
    • Chart
    • KeyValue
    • Progress
    • Timeline
    • Diagram

    Planning

    • Board
    • Calendar

    Inputs

    • Checklist
    • Checkbox
    • Select
    • Switch
    • Slider
    • Button
    • Input
    • Textarea

    Media

    • Image
    • File
    • Placeholder
  • Dynamic props and actions
  • Charts
  • Section templates
  • Validation
  • Stout guarantees
  • Playground
  • Prompting your agent
artifacts.space
DocsSourceSign inCreate accountSupportPrivacyTerms

© 2026 Webrenew LLC

Components · Data

Diagram

A Mermaid diagram (flowchart, sequence, class, state, ER, gantt, and more). Put the Mermaid source in code.

ExamplesLink to this section

A flowchart
Request flow
Drawing diagram…
Show JSONHide JSON
{
  "version": 1,
  "root": "diagram",
  "elements": {
    "diagram": {
      "type": "Diagram",
      "props": {
        "title": "Request flow",
        "code": "flowchart LR\n  Agent -->|MCP| API --> DB[(Postgres)]\n  API --> Page[Artifact page]"
      }
    }
  }
}
A sequence diagram
Drawing diagram…
Show JSONHide JSON
{
  "version": 1,
  "root": "diagram",
  "elements": {
    "diagram": {
      "type": "Diagram",
      "props": {
        "code": "sequenceDiagram\n  Agent->>Server: artifacts_validate\n  Server-->>Agent: Valid ui content\n  Agent->>Server: artifacts_create\n  Server-->>Agent: id and url"
      }
    }
  }
}

PropsLink to this section

Generated from the zod schema the server validates with. Unknown props are ignored with a warning. Any prop can also be a dynamic value such as { "$state": "/path" }; it is checked again once it resolves.

PropTypeLimits and defaults
coderequiredstringmax 20,000 chars
titlestringmax 160 chars

RulesLink to this section

  • Mermaid draws in the browser in strict mode and shows the result as an image, so nothing in the source can run.

Children and eventsLink to this section

Diagram is a leaf: it does not show children. Validation warns when a leaf has some; wrap them in a Stack or Card instead.

It emits no events.

Edit this page on GitHub
PreviousTimelineNextBoard

On this page

  • Examples
  • Props
  • Rules
  • Children and events