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

Metric

A key number with a label, an optional unit, and an optional change. change uses changeFormat (default: the value's format), so a revenue metric usually sets changeFormat "percent". goodDirection says whether up or down is good. sparkline (2-200 numbers, oldest first) draws a small trend line under the value. variant: "plain" shows the number, label, and change without the card, for a band of stats.

ExamplesLink to this section

Currency, change, and a sparkline

Revenue

$1,284,000

+12.4% vs last month

Weekly active

18.4K

+6.1%

Errors

42

+8

Status

Healthy

Show JSONHide JSON
{
  "version": 1,
  "root": "grid",
  "elements": {
    "grid": {
      "type": "Grid",
      "props": { "columns": 2 },
      "children": ["revenue", "active", "errors", "status"]
    },
    "revenue": {
      "type": "Metric",
      "props": {
        "label": "Revenue",
        "value": 1284000,
        "format": "currency",
        "currency": "USD",
        "change": 12.4,
        "changeFormat": "percent",
        "changeLabel": "vs last month",
        "goodDirection": "up"
      }
    },
    "active": {
      "type": "Metric",
      "props": {
        "label": "Weekly active",
        "value": 18420,
        "format": "compact",
        "change": 6.1,
        "changeFormat": "percent",
        "goodDirection": "up",
        "sparkline": [
          12100,
          12900,
          13400,
          13100,
          14800,
          15900,
          15200,
          16700,
          17300,
          18420
        ]
      }
    },
    "errors": {
      "type": "Metric",
      "props": {
        "label": "Errors",
        "value": 42,
        "change": 8,
        "goodDirection": "down"
      }
    },
    "status": {
      "type": "Metric",
      "props": { "label": "Status", "value": "Healthy" }
    }
  }
}

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
labelrequiredstringmax 80 chars
valuerequirednumber | stringmax 40 chars
unitstringmax 20 chars
format"number" | "compact" | "percent" | "currency"—
currencystring3-letter code
changenumber—
changeFormat"number" | "compact" | "percent" | "currency"—
changeLabelstringmax 60 chars
goodDirection"up" | "down"—
sparkline(number | null)[]max 200 items
variant"card" | "plain"—

RulesLink to this section

  • change uses changeFormat, which defaults to the value's format. A revenue metric usually sets changeFormat "percent".
  • goodDirection decides the color: a change in the good direction shows as success, the other way as danger.
  • sparkline takes 2 to 200 numbers, oldest first. null leaves a gap.
  • variant: "plain" drops the card: the label, number, and change sit on whatever is behind them, for a row of stats in a band.

Children and eventsLink to this section

Metric 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
PreviousTableNextChart

On this page

  • Examples
  • Props
  • Rules
  • Children and events