DisplaySet
Show a read-only label and value pair in a two-column or stacked grid, with a placeholder for missing values.
DisplaySet renders a read-only label and its value as a CSS grid built from Text. Use it for detail views such as customer or order summaries. It has no "use client" directive, no state, and no effects, so it can render in server components. It reads theme tokens and should render inside DesignSystemProvider.
Name
Phone
Import#
import { DisplaySet } from "@reactberry/system/blocks";
Usage#
import { DisplaySet } from "@reactberry/system/blocks";
import { Box } from "@reactberry/system/elements";
type Customer = { name: string; email: string; phone?: string | null };
export default function CustomerDetails({ customer }: { customer: Customer }) {
return (
<Box display="flex" flexDirection="column" gap="s">
<DisplaySet label="Name" content={customer.name} />
<DisplaySet label="Email" content={customer.email} />
<DisplaySet label="Phone" content={customer.phone} placeholder="No phone number" />
</Box>
);
}
Examples#
Stacked layout#
flow="column" puts the value below the label, which suits long values.
Delivery address
Notes
Custom columns and value styles#
customFlow sets the grid columns, here a fixed 8rem label column. contentProps styles the value. 0 is shown as content, not as the placeholder.
Status
Plan
Seats
API#
DisplaySet#
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | — | Rendered as an |
content* | any | — | Value to display. When |
flow | "column""row" | "row" |
|
customFlow | string | — |
|
placeholder | ReactNode | not set | Shown when |
contentProps | Record<string, any> | {} | Spread onto the value |
All remaining props are spread onto the outer Text (rendered as a div), after its defaults, so they can override display, gap, gridTemplateColumns, color, and fontWeight.
Accessibility#
- The label is an
h4, so eachDisplaySetadds a heading to the document outline. - The value is a plain
div; label and value are not linked with ARIA or a description list (dl).
Notes#
- The outer element uses
color="secondary",fontWeight700, andgap="xxsmall". The labelh4hasm="0"and inherits these styles. - The value uses
fontWeight400 andcolor="primary", orcolor="tertiary"when the placeholder is shown. - Only
nullandundefinedtrigger the placeholder. Values such as0,false, and""are passed through as content;falseand""render nothing. customFlowis ignored whenflowis"column".