Text
Polymorphic text primitive with body, caption, label, code, and mono variants. Renders as any block or inline HTML tag via the `as` prop.
<Text variant="label" as="span">Total revenue</Text><Text variant="body">Body copy renders here.</Text>
<Text variant="caption" as="span">Last updated 2 hours ago</Text>
<Text variant="label" as="span">Total revenue</Text>
<Text variant="code" as="span">GET /api/users</Text>
<Text variant="mono" as="span">0x1A2B3C</Text>
import type * as React from 'react'
import { cn } from '@/lib/utils'
interface TextProps {
children: React.ReactNode
variant?: 'body' | 'caption' | 'label' | 'code' | 'mono'
as?: 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3'
className?: string
}
const variantClass: Record<NonNullable<TextProps['variant']>, string> = {
body: 'mdn-text-body',
caption: 'mdn-text-caption',
label: 'mdn-text-label',
code: 'mdn-text-code',
mono: 'mdn-text-mono',
}
export function Text({
children,
variant = 'body',
as: Tag = 'p',
className,
}: TextProps): React.JSX.Element {
return (
<Tag className={cn(variantClass[variant], className)}>
{children}
</Tag>
)
}
Button
Dashboard button with primary (solid), secondary (outline), and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.
Badge
Status badge with six color variants: ice, green, amber, red, violet, and surface. Designed for dashboard labels, status indicators, and category tags.
Card
Composable card with Card, CardHeader, and CardBody sub-components. Uses `mdn-card` CSS classes for consistent dashboard panel styling.
StatusPill
Compact status indicator with five semantic states: ok, warn, err, idle, and info. Each state maps to a default label (Healthy, Degraded, Down, Idle, Info) that can be overridden via the label prop.