Skip to content

MDX components

In an .mdx file you can import any Astro component and use it inline. This site ships one of its own, StatusPill, which draws a run status the way the dashboard does. It is the one place the docs use cyan and coral, because there they mean state.

import StatusPill from '../../../components/StatusPill.astro';
A run is <StatusPill state="running" /> until a gate opens, then <StatusPill state="needs-decision" />.

A run is RUNNING until a gate opens, then NEEDS DECISION. When it ends it is COMPLETED, FAILED or REJECTED. A connector problem shows BLOCKED, and a module with nothing active is IDLE.

Badges label things inline: Admin only Experimental. Variants are all neutral in this theme.

A component is an Astro file in src/components/. Keep it flat and token-driven.

src/components/StatusPill.astro
---
export interface Props { state: 'running' | 'completed' | 'needs-decision' | 'blocked' | 'failed' | 'rejected' | 'idle' }
const { state } = Astro.props;
---
<span class="pill" data-state={state}>{state.toUpperCase()}</span>