Data List
Label and value pairs for metadata panels, with subtle and bold label emphasis.
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
12345678910111213141516171819202122232425import { DataList } from "#components/ui/ui-sdk/data-list.tsx";
const details = [ ["Status", "Active"], ["Region", "eu-west-1"], ["Plan", "Pro"],];
export function Example() { return ( // variant/size/orientation resolve once on Root; parts inherit them via // context and expose data-* attributes — the root renders a semantic <dl> <DataList.Root variant="subtle" size="md" orientation="horizontal"> {details.map(([label, value]) => ( <DataList.Item key={label}> <DataList.ItemLabel>{label}</DataList.ItemLabel> <DataList.ItemValue>{value}</DataList.ItemValue> </DataList.Item> ))} </DataList.Root> );}
// horizontal label column width comes from a custom property:// <DataList.ItemLabel style={styles.labelW}> with { "--label-width": "90px" }Variants
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
Sizes
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
- Status
- Active
- Region
- eu-west-1
- Plan
- Pro
- Created
- Mar 12, 2026
Install
1npx stylexblocks add data-listSource
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184import * as stylex from "@stylexjs/stylex";import { createSlotRecipeContext } from "#lib/ui-sdk/create-slot-recipe-context.tsx";import { defineSlotRecipe } from "#lib/recipe-props.ts";import { fontSizes } from '@stylexblocks/ui/tokens/font-sizes.stylex.ts'import { fontWeights } from '@stylexblocks/ui/tokens/font-weights.stylex.ts'import { lineHeights } from '@stylexblocks/ui/tokens/line-heights.stylex.ts'import { semanticColors } from '@stylexblocks/ui/semantic-tokens/colors.stylex.ts'import { spacing } from '@stylexblocks/ui/tokens/spacing.stylex.ts'
const dataListItemLabel = stylex.create({ base: { color: semanticColors.fgMuted, display: 'flex', alignItems: 'center', gap: spacing._1, },})
const dataListItemLabelVariants = stylex.create({ subtle: { color: semanticColors.fgMuted, }, bold: { fontWeight: fontWeights.medium, },})
const dataListItemLabelOrientations = stylex.create({ horizontal: { minWidth: 'var(--label-width, 120px)', },})
const dataListItemValue = stylex.create({ base: { display: 'flex', minWidth: 0, flex: 1, },})
const dataListItemValueVariants = stylex.create({ bold: { color: semanticColors.fgMuted, },})
const dataListRoot = stylex.create({ base: {},})
const dataListRootSizes = stylex.create({ sm: { gap: spacing._3, }, md: { gap: spacing._4, }, lg: { gap: spacing._5, },})
const dataListRootOrientations = stylex.create({ horizontal: { display: 'flex', flexDirection: 'column', }, vertical: { display: 'flex', flexDirection: 'column', },})
const dataListItem = stylex.create({ base: {},})
const dataListItemSizes = stylex.create({ sm: { fontSize: fontSizes.xs, lineHeight: lineHeights.xs, }, md: { fontSize: fontSizes.sm, lineHeight: lineHeights.sm, }, lg: { fontSize: fontSizes.md, lineHeight: lineHeights.md, },})
const dataListItemOrientations = stylex.create({ horizontal: { display: 'inline-flex', alignItems: 'center', gap: spacing._4, }, vertical: { display: 'flex', flexDirection: 'column', gap: spacing._1, },})
export type DataListOrientation = keyof typeof dataListItemLabelOrientations
export type DataListSize = keyof typeof dataListRootSizes
export type DataListVariant = keyof typeof dataListItemLabelVariants
// The parts render definition-list semantics (<dl>/<dt>/<dd>); the preflight// does not zero UA list margins, so the component carries its own resets.const dataListLocal = stylex.create({ dl: { marginBlock: 0 }, dd: { marginInlineStart: 0 },});
// defineSlotRecipe validates the shape at compile time: default values must// exist in the axis maps, and slot keys must be `styles` or a declared axisconst dataListSlotRecipe = defineSlotRecipe({ slots: { root: { styles: dataListRoot, sizes: dataListRootSizes, orientations: dataListRootOrientations, }, item: { styles: dataListItem, sizes: dataListItemSizes, orientations: dataListItemOrientations, }, itemLabel: { styles: dataListItemLabel, variants: dataListItemLabelVariants, orientations: dataListItemLabelOrientations, }, itemValue: { styles: dataListItemValue, variants: dataListItemValueVariants }, }, defaultVariants: { size: "md", orientation: "horizontal", variant: "subtle" },});
/** * DataList — recipe and component colocated in one file. `<DataList.Root * variant size orientation>` resolves the recipe once and every part * inherits it through context; each part composes via `render`. The sparse * maps (label orientation styles only horizontal, value styles only bold) * resolve through explicit resolvers. */const { withProvider, withContext } = createSlotRecipeContext(dataListSlotRecipe);
export const DataList = { Root: withProvider( "dl", (v) => [ dataListRoot.base, dataListRootSizes[v.size], dataListRootOrientations[v.orientation], dataListLocal.dl, ], "DataListRoot", ), Item: withContext("div", "item", "DataListItem"), ItemLabel: withContext( "dt", (v) => [ dataListItemLabel.base, dataListItemLabelVariants[v.variant], v.orientation === "horizontal" && dataListItemLabelOrientations.horizontal, ], "DataListItemLabel", ), ItemValue: withContext( "dd", (v) => [ dataListItemValue.base, v.variant === "bold" && dataListItemValueVariants.bold, dataListLocal.dd, ], "DataListItemValue", ),};
Examples
Installable blocks built with Data List — real use cases, delivered as source you own.
Studio project inquiry form with response-time status, three value-proposition cards, validated contact and scope fields, multi-select topic toggles, team-size and budget selects, referral attribution, and a structured submission confirmation view.
Cloud workspace file manager with a collapsible folder tree, breadcrumb trail, live search, list / grid / Miller-column view switcher, row actions menu, and a synchronized metadata inspector.
Progressive filtering workbench for fleet deployments with saved views and custom view creation, structured field:value filter tokens alongside free-text search, active filter pills, column visibility and row grouping options, sortable columns, and a resizable detail inspector that collapses into a bottom drawer on narrow containers.
Four-step cloud workspace onboarding wizard with a pinned horizontal stepper, per-step validation on advance, plan tier radio cards, live monthly cost estimate, optional skippable team setup, editable review cards, and local launch confirmation.
Three-step scheduled backup policy wizard inside a modal Dialog over a live Arbor Cloud workspace. Features a pinned title and compact stepper header, scrollable per-step validation for target cluster, region, cadence, retention, replication, and KMS encryption, a pinned Back/Continue/Create footer, and live host table updates with toast confirmation.
Single-column accordion-style inline wizard for custom domain and TLS provisioning, featuring compact summary rows with inline Edit/Re-run actions, downstream stale invalidation, a self-running nested DNS preflight check stepper with mismatch simulation and retry recovery, and live cutover activation.
Five-step enterprise SSO and workspace provisioning wizard with a persistent vertical stepper rail, live per-step statuses and summary subtitles, overall progress indicator, draft save tracking, conditional protocol and SIEM fields, broken-step validation flagging, container-responsive top bar collapse, and grouped review and confirmation screens.
Release backlog and change-request table bundling rows into collapsible status, priority, or team groups with per-group counts, expand/collapse-all, query search and release/priority filters, inline stage and priority pickers, a resizable Splitter inspector with readiness checklist and activity timeline, and narrow-screen drawer handoff.
Multi-pane code IDE workspace with a filterable file tree, open and closable editor tabs, line-numbered syntax-highlighted code view, resizable Terminal / Problems / Output workbench, properties and history inspector, and live status bar.
On-call incident response workspace with status-grouped rows, an interactive affected-services health strip, severity and status controls, a resizable detail inspector with live timeline note composer, runbook checklist, responder roster, and bottom-drawer handoff on narrow screens.
Commerce order detail page with breadcrumb navigation, fulfillment and payment status badges, itemized line-item table with product photo thumbnails, invoice breakdown, live shipment tracking timeline, customer and shipping sidebar cards with collapsible risk analysis, cancel-order confirmation dialog, and toast feedback.
Two-column storefront product detail layout pairing a multi-angle interactive photo gallery with a sticky buy box, live anodized finish swatches, color-temperature edition controls, quantity stepper, collapsible specifications accordion, and filterable customer reviews.
Full-page searchable subscriptions and invoices ledger with billing-cycle scope control, status and plan filters, column sorting, multi-row selection with a floating ActionBar, per-row menus, pagination, empty state, and live filtered totals.
Editorial architectural monograph pairing a sticky left-hand project narrative, metadata list, metrics, and actions beside a vertical scrolling plate stack with a keyboard-navigable lightbox dialog.
Hierarchical work breakdown and cost rollup tree table with multi-level expand/collapse, visual tree guide lines, live parent rollups, hierarchical indeterminate selection, ancestor-preserving search and health filters, in-place sibling sorting, keyboard treegrid navigation, a floating bulk ActionBar, and a node inspector Drawer.
Engineering work item detail workspace with breadcrumb navigation, editable status, priority, assignee, and sprint properties rail, interactive sub-task checklist with live progress bar, linked pull requests and commits tabs, and a filterable activity timeline with comment composer.
