Diese Seite ist nicht übersetzt und wird auf Englisch angezeigt.
MESSAI · DESIGN SYSTEM
Tokens, primitives, patterns
Live examples of every design token and component. Click any code block to copy. Click the gear (top right) to tweak token values in real time.
Tokens
Color, type, spacing, radius, shadow, motion — the lowest layer.
Surface
Page, card, and chrome backgrounds.
Ink
Text colors at varying emphasis.
Accent
Brand accent — used sparingly for actions + focus.
Semantic tones
Five tones for status pills, alerts, and inline messages.
<div style={{
backgroundColor: 'var(--messai-positive-bg)',
color: 'var(--messai-positive-ink)',
border: '1px solid var(--messai-positive-edge)',
}}>healthy</div>Spacing scale
4px baseline rhythm. Use space.4 (16px) as the default gap.
gap: 'var(--messai-space-4)' // 16pxRadius scale
Sharp corners are the project default — never use border-radius unless explicitly requested.
borderRadius: 'var(--messai-radius-base)' // 0 (no-radius rule)Shadow scale
Restrained elevation. focus is reserved for keyboard focus rings.
boxShadow: 'var(--messai-shadow-md)'Motion / duration
Earned animation. Press Play to see each token's pacing.
transition: 'background-color var(--messai-duration-base) var(--messai-ease-inOut)'Atoms
Single-purpose primitives — Eyebrow, Pill, typography, buttons.
Eyebrow + Pill
Atomic chrome — labels, status indicators.
Eyebrow
<Eyebrow>PERFORMANCE</Eyebrow>Pill — semantic tones
<Pill tone="positive">healthy</Pill>
<Pill tone="caution">attention</Pill>
<Pill tone="critical">error</Pill>
<Pill tone="neutral">label</Pill>
<Pill tone="info">info</Pill>Typography
Type scale across sans / serif / mono.
Type scale
xs · The microbial fuel cell achieved 1.25 W/m²
sm · The microbial fuel cell achieved 1.25 W/m²
base · The microbial fuel cell achieved 1.25 W/m²
lg · The microbial fuel cell achieved 1.25 W/m²
xl · The microbial fuel cell achieved 1.25 W/m²
2xl · The microbial fuel cell achieved 1.25 W/m²
<p style={{ fontSize: 'var(--messai-size-xs)' }}>xs (12px)</p>
<p style={{ fontSize: 'var(--messai-size-base)' }}>base (16px)</p>
<p style={{ fontSize: 'var(--messai-size-2xl)' }}>2xl (24px)</p>Font families
Sans · Inter — UI chrome and body text
Serif · Source Serif 4 — titles and editorial emphasis
Mono · JetBrains Mono — values, units, tabular data
<p style={{ fontFamily: 'var(--messai-font-sans)' }}>sans</p>
<p style={{ fontFamily: 'var(--messai-font-serif)' }}>serif</p>
<p style={{ fontFamily: 'var(--messai-font-mono)' }}>mono</p>Buttons
Three button rhythms. (Task 6 Button rewrite pending.)
Buttons
<button>Primary</button>
<button>Secondary</button>
<button>Ghost</button>Molecules
Composed patterns — anchored cards, card grids, form groups.
AnchoredCard — click to open
<AnchoredCard open={open} onClose={close} anchor={{ top: 40, right: 0 }} ariaLabel="..." width={240}>
{/* content */}
</AnchoredCard>Card grid
<div style={{
backgroundColor: 'var(--messai-surface-surface)',
border: '1px solid var(--messai-surface-border)',
borderRadius: 'var(--messai-radius-base)',
padding: 16,
}}>
<Eyebrow>REACTOR</Eyebrow>
<h4>Single-chamber MFC</h4>
<p>Carbon felt anode + air cathode.</p>
<Pill tone="positive">active</Pill>
</div>Form group — label + input + helper + error
<label>External resistance</label>
<input type="text" />
<div className="helper">Ohms (Ω) — the load resistor across the cell.</div>Organisms
Surfaces — stat blocks, tables, inspector panels.
Stat / metric block
<div>
<span className="label">Power density</span>
<span className="value">1.25</span>
<span className="unit">W/m²</span>
</div>Table / data grid
| Reactor | W/m² | % | Source |
|---|---|---|---|
| Single-chamber air-cathode MFC | 1.25 | 45 | 10.0000/example-a |
| Stacked MFC (4 cells) | 0.88 | 38 | 10.0000/example-b |
| Two-chamber MFC | 0.42 | 62 | 10.0000/example-a |
| Sediment MFC | 0.03 | 21 | 10.0000/example-b |
import {
DataTable, TableHead, TableBody, TableRow, TableHeaderCell, TableCell,
} from '@messai/ui';
<DataTable aria-label="Reactor performance">
<TableHead>
<TableRow hover={false}>
<TableHeaderCell>Reactor</TableHeaderCell>
{/* numeric = right-aligned; unit sits under the label, cells stay bare */}
<TableHeaderCell numeric unit="W/m²" sort={dir} onSort={toggle}>
Power density
</TableHeaderCell>
<TableHeaderCell>Source</TableHeaderCell>
</TableRow>
</TableHead>
<TableBody>
{rows.map((r) => (
<TableRow key={r.id}>
<TableCell>{r.reactor}</TableCell>
<TableCell numeric>{r.powerDensity.toFixed(2)}</TableCell>
<TableCell muted>{r.source}</TableCell>
</TableRow>
))}
</TableBody>
</DataTable>
// Config-driven shortcut (built-in sort / empty / loading):
<Table columns={columns} rows={rows} rowKey={(r) => r.id} />
// Astro pages (no React) apply the same recipe as classes:
import { tableStyles } from '@messai/ui'; // React-free: '@messai/ui/table-styles'
// class={tableStyles.table} · {tableStyles.headerCell} · {tableStyles.cell}Inspector panel — sticky right rail
<aside className="inspector">
<Eyebrow>INSPECTOR</Eyebrow>
<h3>Paper context</h3>
{rows.map(row => (
<div className="row">
<span className="label">{row.label}</span>
<span className="value">{row.value}</span>
</div>
))}
</aside>