Descriptions
Descriptions presents labeled record fields for summaries, details, and review screens.
@duskmoon-dev/components/descriptions Usage
When to use
- Use it when users need to scan structured content and act on individual records.
- Prefer it over ad hoc markup when the content has repeatable fields, hierarchy, or navigation state.
Implementation notes
Features
Designed for repeated or hierarchical content where users scan, compare, and inspect details.
Documents the props that control sorting, selection, expansion, pagination, or value changes where available.
Descriptions is most often configured through `title`, `extra`, `items`, `bordered`.
Renders title and children items
Feature Demos
Feature demos are authored for the component page, then supplemented with behavior scenarios from the component test coverage.
Basic usage
Import the component stylesheet and Descriptions from its package subpath, then render it with the core props.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function Example() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Renders title and children items
test-backedDescriptions scenario from the component test coverage: renders title and children items.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function DescriptionsRendersTitleAndChildrenDemo() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Renders items prop and extra content
test-backedDescriptions scenario from the component test coverage: renders items prop and extra content.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function DescriptionsRendersItemsPropAndDemo() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Applies bordered, size, layout, column, span, and custom class
test-backedDescriptions scenario from the component test coverage: applies bordered, size, layout, column, span, and custom class.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function DescriptionsAppliesBorderedSizeLayoutDemo() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Applies root and item label/content styles
test-backedDescriptions scenario from the component test coverage: applies root and item label/content styles.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function DescriptionsAppliesRootAndItemDemo() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Forwards root ref
test-backedDescriptions scenario from the component test coverage: forwards root ref.
import "@duskmoon-dev/components/styles.css";
import { Descriptions } from "@duskmoon-dev/components/descriptions";
export function DescriptionsForwardsRootRefDemo() {
return (<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>);
} Theme aware
Docs previews inherit the DuskMoon data-theme value. Use the header switch to compare light and dark rendering.
<div data-theme="sunshine">
<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>
</div>
<div data-theme="moonlight">
<Descriptions
title="Release summary"
bordered
column={2}
items={[
{ key: "status", label: "Status", children: "Ready" },
{ key: "owner", label: "Owner", children: "DuskMoon" },
{ key: "version", label: "Version", children: "0.1.2" },
{ key: "channel", label: "Channel", children: "Stable" }
]}
/>
</div> API
The API reference below lists every parsed exported type or interface for Descriptions. Start with `title`, `extra`, `items`, `bordered` for common usage.
packages/components/src/components/descriptions/Descriptions.types.ts
Scenarios: packages/components/src/components/descriptions/Descriptions.test.tsx | Prop | Type | Required | Description |
|---|---|---|---|
title | ReactNode | No | title configures Descriptions. |
extra | ReactNode | No | extra configures Descriptions. |
items | DescriptionsItemType[] | No | items configures Descriptions. |
children | ReactNode | No | children configures Descriptions. |
bordered | boolean | No | bordered configures Descriptions. |
size | DescriptionsSize | No | size configures Descriptions. |
column | DescriptionsColumn | No | column configures Descriptions. |
layout | DescriptionsLayout | No | layout configures Descriptions. |
labelStyle | CSSProperties | No | labelStyle configures Descriptions. |
contentStyle | CSSProperties | No | contentStyle configures Descriptions. |
| Prop | Type | Required | Description |
|---|---|---|---|
key | string | number | No | key configures Descriptions. |
label | ReactNode | No | label configures Descriptions. |
children | ReactNode | No | children configures Descriptions. |
span | DescriptionsSpan | No | span configures Descriptions. |
className | string | No | className configures Descriptions. |
labelStyle | CSSProperties | No | labelStyle configures Descriptions. |
contentStyle | CSSProperties | No | contentStyle configures Descriptions. |
| Prop | Type | Required | Description |
|---|---|---|---|
label | ReactNode | No | label configures Descriptions. |
children | ReactNode | No | children configures Descriptions. |
span | DescriptionsSpan | No | span configures Descriptions. |
labelStyle | CSSProperties | No | labelStyle configures Descriptions. |
contentStyle | CSSProperties | No | contentStyle configures Descriptions. |
| "small" | "middle" | "default" | "sm" | "md" | "lg" "horizontal" | "vertical" "xs" | "sm" | "md" | "lg" | "xl" | "xxl" Partial< Record<DescriptionsBreakpoint, number> > number | DescriptionsResponsiveValue number | DescriptionsResponsiveValue | "filled" ForwardRefExoticComponent< DescriptionsItemProps & RefAttributes<HTMLDivElement> > ForwardRefExoticComponent< DescriptionsProps & RefAttributes<HTMLDivElement> > & { Item: DescriptionsItemComponent