Data Primitives
v0.1.1Domain-agnostic presentational atoms for dense data surfaces: SectionLabel, MetaBox, EmptyState, TagList, and DataListRow. Pure props-in rendering, composable across any domain.
Install
npx shadcn@latest add @signalos/data-primitivesRequires a configured @signalos registry and a valid SIGNALOS_REGISTRY_TOKEN - get access. Registry dependencies (@signalos/tokens, @signalos/utils, @signalos/badge) are pulled automatically.
Preview
Example & code
data-primitives.example.tsx
// Example: dense data atoms composed inside a detail-panel section.
import { Link2, Tag, Zap } from "lucide-react"
import {
DataListRow,
EmptyState,
MetaBox,
SectionLabel,
TagList,
} from "@/components/widgets/data-primitives/DataPrimitives"
import { StatusBadge } from "@/components/widgets/status-badge/StatusBadge"
export default function Example() {
return (
<div className="flex max-w-md flex-col gap-4">
<div>
<SectionLabel icon={<Zap className="h-3 w-3" />}>
Contributing metrics
</SectionLabel>
<div className="mt-2">
<TagList
items={[
"coverage_rate",
"latency_p95",
"error_rate",
"queue_depth",
]}
max={3}
/>
</div>
</div>
<div className="grid grid-cols-3 gap-2">
<MetaBox label="Age" value="3d 1h" />
<MetaBox label="Routed" value="+37s" />
<MetaBox label="Signals" value="16" />
</div>
<div>
<SectionLabel icon={<Link2 className="h-3 w-3" />}>
Related
</SectionLabel>
<ul className="mt-2 flex flex-col gap-1.5">
<DataListRow
leading={<StatusBadge severity="high" appearance="chip" />}
eyebrow="6E7F3696"
primary="Coverage collapse across tenants"
badges={[{ label: "EXPIRED" }]}
meta="2d ago"
onSelect={() => {}}
/>
</ul>
</div>
<div>
<SectionLabel icon={<Tag className="h-3 w-3" />}>
Transfers
</SectionLabel>
<div className="mt-2">
<EmptyState
icon={<Tag className="h-5 w-5" />}
label="No transfers recorded."
/>
</div>
</div>
</div>
)
}
Props
SectionLabelProps
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | ReactNode | - | Optional leading icon (typically a 12px lucide glyph). |
| children* | ReactNode | - | Uppercased mono eyebrow text. |
| className | string | undefined | - |
MetaBoxProps
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | ReactNode | - | Small uppercased caption. |
| value* | ReactNode | - | Emphasised mono value. |
| className | string | undefined | - |
EmptyStateProps
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | ReactNode | - | Optional muted illustration/icon. |
| label* | ReactNode | - | Primary message. |
| description | ReactNode | - | Optional supporting copy under the label. |
| className | string | undefined | - |
TagListProps
| Prop | Type | Default | Description |
|---|---|---|---|
| items* | readonly ReactNode[] | - | Values rendered as mono code chips. |
| max | number | undefined | - | Cap the number of visible chips; the remainder collapses into a "+N" counter. Omit to show all. |
| className | string | undefined | - |
DataListRowBadge
| Prop | Type | Default | Description |
|---|---|---|---|
| label* | ReactNode | - | |
| variant | "default" | "secondary" | "outline" | undefined | "secondary" | Maps to the underlying Badge variant. |
DataListRowProps
| Prop | Type | Default | Description |
|---|---|---|---|
| leading | ReactNode | - | Leading slot — a status badge, icon, or severity chip. |
| eyebrow | ReactNode | - | Optional mono identifier shown before the primary text. |
| primary* | ReactNode | - | Primary, truncating text. |
| badges | readonly DataListRowBadge[] | undefined | - | Optional trailing pills (e.g. a status). |
| meta | ReactNode | - | Optional trailing meta (e.g. a relative timestamp). |
| onSelect | (() => void) | undefined | - | Makes the row interactive with button semantics. |
| className | string | undefined | - |
Changelog
data-primitives
0.1.1
- Add the missing
"use client"directive -DataListRowwiresonClick/onKeyDown, which crashes in a server-component tree without it.
0.1.0
- Initial release, extracted from the
attention-routing-01block's local components. Ships five domain-agnostic atoms —SectionLabel,MetaBox,EmptyState,TagList, andDataListRow— as reusable, props-driven building blocks for dense data surfaces (cards, detail panels, list rows).