Descriptions
Details groups with borders, responsive columns, full rows, snippets and semantic styles.
When to use
Margins and row placement
items contains label, children and an optional key. The content can be a string, a number, or a Svelte snippet. title and extra specify the title of the block and the action next to it.
| Problem | Property | Example |
|---|---|---|
| Show details without frame | items |
Basic fields |
| Separate cells with frames | bordered |
Tabular design |
| Place a label above the value | layout="vertical" |
Vertical arrangement |
| Change the number of columns on the screen | responsive column |
Adaptive layout |
| Occupy the rest of the line | span="filled" |
Wide field |
column specifies the number of logical columns. The span of a particular item spans several columns, but is limited to the remainder of the current line. filled fills this remainder; To make the field fill the entire line, place it after the completed line.
Layout:horizontal displays a label next to the value, vertical separates them by line. bordered adds borders and caption backgrounds. colon controls the colon where it is used by the layout.
Adaptability and dimensions
column and numeric span can accept breakpoint value maps. The selection is made by viewport via matchMedia. For responsive maps, SSR uses a three-column fallback, then mount applies the actual screen. Don't expect the number of rows to remain the same after hydration.
Thresholds are set by global theme.token.screen* in ConfigProvider, like Grid. The nested provider inherits them, theme.inherit: false returns the standard values along with the rest of the theme design tokens. Topic Thresholds compare these areas: the same column/span can give different layouts with the same viewport width. Updating tokens replaces media queries without recreating the first cell and its editor. Theme only with mode/primary/compact retains the standard thresholds.
For xs the max-width screenXSMax is used, for sm and the following sizes - min-width screenSM, screenMD and so on. screenSMMin and the rest of min/max are involved in order checking; they do not replace the underlying request threshold. If a gap is left between xs and sm, neither card will match: the number of columns will revert to fallback 3, and span will resolve separately. Coordinate adjacent boundaries; an incorrect order is already rejected with SSR. Resize and changing tokens preserve the entered text and the state of the instance.
size supports current large/medium/small. An absent size and an explicit medium can produce different geometries: changing the size name cannot be considered visually neutral. Check for the right combination of size, bordered and general ConfigProvider, as in size example.
Long values should wrap or have local scrolling without expanding the entire page. For actions in extra, use the available button or link. Accompany the status in the value with text, not just one Badge color.
Semantic styles and theme
ConfigProvider.descriptions specifies class/style and semantic defaults. A nested record replaces the entire parent record. At root, the local style overrides the local semantic layer, which comes after the provider style and provider semantic.
styles.label/content styles all cells, and items.styles.label/content defines a single field. The values are CSS strings. Descriptions tokens control colors, caption backgrounds, padding, and heading; provider settings show priorities without changing neighboring blocks.
prefixCls sets the full local prefix of the root, header/title/extra, view/row, captions and values. The empty string and undefined select ConfigProvider.prefixCls with the -descriptions suffix. Semantic callbacks get the original local props.prefixCls; theme.cssVar.prefix specifies a separate variable namespace. Information prefixes show independent theme scopes and preservation of DOM, bind:nativeElement, text, selection, focus and FormData when changing prefix.
In the expanded Table row, special CSS rules take into account the common Table prefix and the local Descriptions prefix. Svelte saves this decoration with local prefixCls; in the Ant Design 6.6.8 reference, the local prefix is skipped. The example sets Table to a separate region with prefixCls:ant, independent of the Descriptions prefixes. Table's own prefixes are shown in table example.
Fields are passed by the items array; A separate Descriptions.Item is not needed in the markup. bind:nativeElement provides the root div after the mount. The table structure is intended to be displayed and does not automatically create an editing form.
Examples
NameAnna Novikova | RoleDeveloper | CityMoscow |
Mailanna@example.com | TeamInterfaces | ProjectComponent Library |
Basic information
Related fields are read-only; Columns adjust to fit the width of the screen.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions title={("Project participant")} items={([
{ key: 'name', label: "Name", children: "Anna Novikova" },
{ key: 'role', label: "Role", children: "Developer" },
{ key: 'city', label: "City", children: "Moscow" },
{ key: 'email', label: "Mail", children: 'anna@example.com' },
{ key: 'team', label: "Team", children: "Interfaces" },
{ key: 'project', label: "Project", children: "Component Library" }
])} />
| Name | Project API It does not have | Status | Success Working | Region | Europe |
|---|---|---|---|---|---|
| Description | The service publishes data for the interface. | ||||
Table with frame
Cell borders and label backgrounds separate field names from values.
<script lang="ts">
import { Badge, Descriptions } from '@woodger/antd';
</script>
{#snippet status()}<Badge status="success" text={("Working")} />{/snippet}
<Descriptions title={("Service parameters")} bordered items={([
{ key: 'name', label: "Name", children: "Project API\nIt does not have" },
{ key: 'status', label: "Status", children: status },
{ key: 'region', label: "Region", children: "Europe" },
{
key: 'details',
label: "Description",
children: "The service publishes data for the interface.",
span: 'filled'
}
])} />
| Number | AD-1042 | Condition | Ready to ship | Delivery | Courier |
|---|
Dimensions
Switching large, medium and small changes the indents of the table with a frame.
<script lang="ts">
import { Descriptions, Select } from '@woodger/antd';
let size = $state<'small' | 'medium' | 'large'>('medium');
</script>
<style>.controls { margin-bottom:16px; }</style>
<div
class="controls"
><Select
aria-label={("Size Descriptions")}
bind:value={size}
options={([
{ value: 'large', label: "Large" }, { value: 'medium', label: "Regular" }, {
value: 'small',
label: "Small"
}
])}
/></div>
<Descriptions {size} bordered title={("Order")} items={([
{ key: 'number', label: "Number", children: 'AD-1042' },
{ key: 'state', label: "Condition", children: "Ready to ship" },
{ key: 'delivery', label: "Delivery", children: "Courier" }
])} />
| Wednesday | Svelte 5 | Language | TypeScript | Assembly | Vite |
|---|---|---|---|---|---|
| Package | @woodger/antd | Description | Components are connected via the public npm API. | ||
Adaptive speakers
Number of columns: one for xs, two for sm, three for lg. span=filled fills the rest of the line.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions
id="descriptions-responsive-fields"
title={("Project environment")}
bordered
column={{ xs: 1, sm: 2, lg: 3 }}
items={([
{ key: 'runtime', label: "Wednesday", children: 'Svelte 5' },
{ key: 'language', label: "Language", children: 'TypeScript' },
{ key: 'build', label: "Assembly", children: 'Vite' },
{ key: 'package', label: "Package", children: '@woodger/antd' },
{
key: 'details',
label: "Description",
children: "Components are connected via the public npm API.",
span: 'filled'
}
])}
/>
Team | Responsible | Members |
|---|---|---|
Interfaces | Anna Novikova | 6 people |
Project | ||
Component Library | ||
Vertical labels
In layout=vertical, labels and values occupy separate lines.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions title={("Team")} layout="vertical" items={([
{ key: 'name', label: "Team", children: "Interfaces" },
{ key: 'lead', label: "Responsible", children: "Anna Novikova" },
{ key: 'members', label: "Members", children: "6 people" },
{ key: 'project', label: "Project", children: "Component Library", span: 'filled' }
])} />
| Number | Author | Condition |
|---|---|---|
| REQ-204 | Anna Novikova | Under review |
| Comment | ||
| Check availability of new components. | ||
Vertical table with frame
Vertical arrangement in combination with bordered.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions title={("Application")} layout="vertical" bordered items={([
{ key: 'number', label: "Number", children: 'REQ-204' },
{ key: 'owner', label: "Author", children: "Anna Novikova" },
{ key: 'state', label: "Condition", children: "Under review" },
{
key: 'details',
label: "Comment",
children: "Check availability of new components.",
span: 'filled'
}
])} />
| Name | Ant Design Svelte | Responsible | Anna Novikova | Description | The local style specifies the general one. |
|---|
Semantic DOM
General styles and settings for a specific element draw up labels and values.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions title={("Own design")} bordered styles={({ props }) => ({
title: 'font-size:18px',
label: `font-weight:${props.bordered ? 600 : 400}`,
content: 'line-height:1.8'
})} items={([
{ key: 'name', label: "Name", children: 'Ant Design Svelte' },
{
key: 'owner', label: "Responsible", children: "Anna Novikova", styles: {
label: 'color:var(--ant-color-success-text)'
}
},
{
key: 'details',
label: "Description",
children: "The local style specifies the general one.",
span: 'filled'
}
])} />
| Name | Component Library | ||||
|---|---|---|---|---|---|
| Wednesday | Svelte | Language | TypeScript | License | MIT |
| Description | Reusable components for user interfaces. | ||||
Full line
span=filled stretches the field to the entire remaining width; the remaining fields are placed in regular columns.
<script lang="ts">
import { Descriptions } from '@woodger/antd';
</script>
<Descriptions title={("Project materials")} bordered items={([
{ key: 'title', label: "Name", children: "Component Library", span: 'filled' },
{ key: 'runtime', label: "Wednesday", children: 'Svelte' },
{ key: 'language', label: "Language", children: 'TypeScript' },
{ key: 'license', label: "License", children: 'MIT' },
{
key: 'details',
label: "Description",
children: "Reusable components for user interfaces.",
span: 'filled'
}
])} />
ServiceProject API
It does not have | Condition Success Working | ModeDemo |
Status and action in header
extra and field value accept Snippet; the button changes the state of the application.
<script lang="ts">
import { Badge, Button, Descriptions } from '@woodger/antd';
let updating = $state(false);
</script>
{#snippet extra()}
<Button size="small" onclick={() => { updating = !updating; }}>
{("Update")}
</Button>
{/snippet}
{#snippet status()}<Badge status={updating ? 'processing' : 'success'} text={(updating ? "Updated" : "Working")} />{/snippet}
<Descriptions
title={("Service status")}
extra={(extra)}
items={([
{ key: 'name', label: "Service", children: "Project API\nIt does not have" },
{ key: 'status', label: "Condition", children: status },
{ key: 'mode', label: "Mode", children: "Demo" }
])}
/>
LanguageTypeScript | WednesdaySvelte 5 | |
Overall size and colon
Size from ConfigProvider and explicit design of labels via colon.
<script lang="ts">
import { Checkbox, ConfigProvider, Descriptions } from '@woodger/antd';
let colon = $state(true);
</script>
<style>.controls { margin-bottom:16px; }</style>
<div
class="controls"
><Checkbox
bind:checked={colon}
>{("Colon in labels")}</Checkbox></div>
<ConfigProvider
componentSize="small"
><Descriptions
title={("General settings")}
{colon}
items={([
{ key: 'language', label: "Language", children: 'TypeScript' },
{ key: 'runtime', label: "Wednesday", children: 'Svelte 5' }
])}
/></ConfigProvider>
| Project | Ant Design Svelte |
|---|---|
| Owner | Anna |
| Status | Suspended |
ProjectStandard design |
Settings Descriptions
General class/style and semantic defaults, local cell styles and nested record reset.
<script lang="ts">
import { Button, Checkbox, ConfigProvider, Descriptions } from '@woodger/antd';
let green = $state(true);
let active = $state(false);
const accent = $derived(green ? '#237804' : '#874d00');
</script>
<style>
.settings { margin-bottom: 24px; }
.examples {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 24px;
}
</style>
<div class="settings">
<Checkbox bind:checked={green}>
{("Green settings Descriptions")}
</Checkbox>
</div>
<ConfigProvider
descriptions={{
class: 'provider-descriptions',
style: 'border-radius:8px',
classNames: { root: 'context-descriptions-root' },
styles: ({ props }) => ({
root: 'border-radius:4px',
title: `color:${accent}`,
label: props.bordered ? `
background: #f6ffed;
color: #237804;
` : '',
content: `color:${accent}`
})
}}
>
<div class="examples">
<Descriptions title={("General settings")} bordered column={1}
class="local-descriptions" style="border-radius:16px"
classNames={{ root: 'local-descriptions-root' }}
styles={{
root: 'border-radius:12px',
label: 'font-weight:700',
header: `
flex-wrap: wrap;
gap: 12px;
`
}} extra={(extra)}
items={([
{ key: 'project', label: "Project", children: 'Ant Design Svelte' },
{ key: 'owner', label: "Owner", children: "Anna", styles: { content: 'color:#722ed1' } },
{ key: 'status', label: "Status", children: active ? "Active" : "Suspended" }
])} />
<ConfigProvider descriptions={{}}>
<Descriptions title={("After reset")} column={1}
items={([{
key: 'project',
label: "Project",
children: "Standard design"
}])} />
</ConfigProvider>
</div>
</ConfigProvider>
{#snippet extra()}
<Button onclick={() => { active = !active; }}>
{("Change service status")}
</Button>
{/snippet}
StatusNo changes |
Project | |
|---|---|
| Ant Design Svelte | |
One local class is used in different areas of the topic. Changing the prefix preserves the root, cell and field; The namespace of theme variables is set separately.
Table has an independent ant area. The local Descriptions prefix preserves the appearance within the expanded string. The field in the snippet is used to check the status; for editing forms use Form.
Information and cell prefixes
General and local prefixCls, independent topic areas and information in the expanded Table row. Changing the prefix preserves the field and its FormData.
<script lang="ts">
import { Button, Checkbox, ConfigProvider, Descriptions, Input, Table } from '@woodger/antd';
let custom = $state(true);
let local = $state(true);
let bordered = $state(true);
let vertical = $state(false);
let rtl = $state(false);
let draft = $state(("Draft project"));
let submitted = $state('—');
let nativeElement = $state<HTMLDivElement>();
const prefix = $derived(custom ? 'suite' : 'ant');
</script>
<style>
.example {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 24px;
min-width: 0;
}
.controls {
display: flex;
flex-wrap: wrap;
gap: 12px;
}
form {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 16px;
}
section { min-width: 0; }
p { margin: 0; }
output { overflow-wrap: anywhere; }
</style>
{#snippet editor()}
<Input name="draft" bind:value={draft} aria-label={("Draft Descriptions with prefix")}
style="
width: 100%;
min-width: 0;
" />
{/snippet}
{#snippet details(record: { name: string })}
<Descriptions
prefixCls={local ? 'project-details' : ''}
rootClassName="prefix-descriptions-expanded"
title={("Recording data")}
column={1}
{bordered}
items={([
{ key: 'name', label: "Project", children: record.name },
{ key: 'status', label: "Status", children: "Ready for publication" }
])}
/>
{/snippet}
<div class="example">
<div class="controls">
<Checkbox bind:checked={custom}>{("General prefix Descriptions suite")}</Checkbox>
<Checkbox bind:checked={local}>{("Local prefix Descriptions")}</Checkbox>
<Checkbox bind:checked={bordered}>{("Descriptions frame with prefix")}</Checkbox>
<Checkbox
bind:checked={vertical}
>{("Vertical Descriptions with prefix")}</Checkbox>
<Checkbox bind:checked={rtl}>{("RTL Descriptions with prefix")}</Checkbox>
</div>
<ConfigProvider prefixCls={prefix} direction={rtl ? 'rtl' : 'ltr'}
theme={{
cssVar: { prefix: 'details-theme' },
components: { Descriptions: { titleColor: '#389e0d' } }
}}>
<section aria-label={("Basic information with prefix")}>
<form onsubmit={event => {
event.preventDefault();
submitted = String(new FormData(event.currentTarget).get('draft') ?? '');
}}>
<Descriptions
bind:nativeElement
prefixCls={local ? 'project-details' : ''}
rootClassName="prefix-descriptions-main"
title={("Project parameters")}
column={1}
extra={("Main area")}
{bordered}
layout={vertical ? 'vertical' : 'horizontal'}
classNames={({ props }) => ({
root: props.prefixCls ? 'details-local-prop' : 'details-provider-prop'
})}
styles={{ header: `
flex-wrap: wrap;
gap: 8px;
` }}
items={([
{ key: 'name', label: "Project", children: 'Ant Design Svelte' },
{ key: 'draft', label: "Draft", children: editor },
{ key: 'status', label: "Status", children: "At work" }
])}
/>
<div><Button htmlType="submit">{("Read FormData")}</Button></div>
<output
aria-label={("FormData Descriptions")}
>{("Sent: ")}{submitted}</output>
</form>
</section>
</ConfigProvider>
<ConfigProvider prefixCls="neighbor"
theme={{
cssVar: { prefix: 'neighbor-theme' },
components: { Descriptions: { titleColor: '#d48806' } }
}}>
<section aria-label={("Adjacent information with prefix")}>
<Descriptions
prefixCls={local ? 'project-details' : ''}
rootClassName="prefix-descriptions-neighbor"
title={("Independent region")}
column={1}
items={([{ key: 'status', label: "Status", children: "No changes" }])}
/>
</section>
</ConfigProvider>
<ConfigProvider prefixCls="ant">
<section aria-label={("Descriptions in the expanded Table row")}>
<Table
dataSource={([{ key: 'project', name: 'Ant Design Svelte' }])}
columns={([{ key: 'name', title: "Project", dataIndex: 'name' }])}
caption={("Information inside Table")}
pagination={(false)}
size="small"
expandable={{ expandedRowRender: details, defaultExpandedRowKeys: ['project'] }}
/>
</section>
</ConfigProvider>
<output
aria-label={("Prefix Descriptions")}
>{("\n General: ")}{prefix}{("; class: ")}{(local ? 'project-details' : prefix + '-descriptions')}
</output>
<output aria-label={("Root Descriptions")}>{(nativeElement ? "Connected" : "Waiting mount")}</output>
<p>
{("One local class is used in different areas of the topic. Changing the prefix preserves the root, cell and field; The namespace of theme variables is set separately.")}
</p>
<p>
{("Table has an independent ant area. The local Descriptions prefix preserves the appearance within the expanded string. The field in the snippet is used to check the status; for editing forms use Form.")}
</p>
</div>
| Name | Ant Design Svelte | Wednesday | Svelte 5 / TypeScript | Status | Working |
|---|---|---|---|---|---|
| Description | Self-hosted component library with themes, RTL and SSR. | ||||
Service parameters
Saved review example: switching the frame, vertical layout and responsive columns.
<script lang="ts">
import { Descriptions, Tag } from '@woodger/antd';
let bordered = $state(true);
let vertical = $state(false);
</script>
<style>
.controls {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 16px;
}
.controls label {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
}
</style>
{#snippet status()}<Tag color="success">{("Working")}</Tag>{/snippet}
<div class="controls">
<label><input type="checkbox" bind:checked={bordered} />{(" Frame")}</label>
<label><input type="checkbox" bind:checked={vertical} />{(" Vertical")}</label>
</div>
<Descriptions
title={("Service parameters")}
{bordered}
layout={vertical ? 'vertical' : 'horizontal'}
column={{ xs: 1, sm: 2, lg: 3 }}
items={([
{ key: 'name', label: "Name", children: 'Ant Design Svelte' },
{ key: 'runtime', label: "Wednesday", children: 'Svelte 5 / TypeScript' },
{ key: 'status', label: "Status", children: status },
{
key: 'description',
label: "Description",
children: "Self-hosted component library with themes, RTL and SSR.",
span: 'filled'
}
])}
/>
Column and span use the width of the viewport, not the card. Thresholds are passed via theme.token.screen* and are inherited by the nested ConfigProvider; inherit:false returns default values. ScreenSMMin is involved in order checking, the sm request itself uses screenSM. There may be a gap between xs and sm: there is a fallback in three columns, and the responsive span is selected separately. Changing tokens preserves the state of the first cell and the DOM of the editor. Before mount, SSR uses the same fallback in three columns.
Topic thresholds and inheritance
Global screen* tokens change the responsive column/span without rebuilding the editor. Comparison of parent theme, nested inheritance and inherit:false; separate screenSMMin and screenSM.
Breakpoints.svelte<script lang="ts"> import { Checkbox, ConfigProvider } from '@woodger/antd'; import BreakpointFields from './BreakpointFields.svelte'; let custom = $state(true); let separateMinimum = $state(false); let bordered = $state(true); let vertical = $state(false); const layout = $derived(vertical ? 'vertical' : 'horizontal'); const token = $derived( custom ? { screenXSMax: 639, screenSMMin: 640, screenSM: separateMinimum ? 680 : 640, screenSMMax: 899, screenMDMin: 900, screenMD: separateMinimum ? 920 : 900 } : {} ); </script> <style> .example, .scopes { display: grid; gap: 24px; min-width: 0; } .controls { display: flex; flex-wrap: wrap; gap: 12px; } p { margin: 0; } output { overflow-wrap: anywhere; } </style> <div class="example"> <div class="controls"> <Checkbox bind:checked={custom}>{("Own thresholds Descriptions")}</Checkbox> <Checkbox bind:checked={separateMinimum} >{("Separate screenSMMin and screenSM")}</Checkbox> <Checkbox bind:checked={bordered}>{("Frame at its thresholds")}</Checkbox> <Checkbox bind:checked={vertical} >{("Vertical labels at their thresholds")}</Checkbox> </div> <ConfigProvider theme={{ token }}> <div class="scopes"> <BreakpointFields id="custom" title={("Parent thresholds")} {bordered} {layout} /> <ConfigProvider> <BreakpointFields id="inherited" title={("Legacy thresholds")} {bordered} {layout} /> </ConfigProvider> <ConfigProvider theme={{ inherit: false }}> <BreakpointFields id="reset" title={("Reset inheritance")} {bordered} {layout} /> </ConfigProvider> </div> </ConfigProvider> <output aria-label={("Thresholds Descriptions")}> {(custom ? `xs ≤ 639px; sm ≥ ${separateMinimum ? 680 : 640}px; md ≥ ${separateMinimum ? 920 : 900}px` : "Standard thresholds: xs ≤ 575px; sm ≥ 576px; md ≥ 768px")} </output> <p> {("Column and span use the width of the viewport, not the card. Thresholds are passed via theme.token.screen* and are inherited by the nested ConfigProvider; inherit:false returns default values. ScreenSMMin is involved in order checking, the sm request itself uses screenSM. There may be a gap between xs and sm: there is a fallback in three columns, and the responsive span is selected separately. Changing tokens preserves the state of the first cell and the DOM of the editor. Before mount, SSR uses the same fallback in three columns.")} </p> </div>BreakpointFields.svelte<script lang="ts"> import { Descriptions, Input, type DescriptionsProps } from '@woodger/antd'; let { id, title, bordered, layout }: { id: string; title: string; bordered: boolean; layout: DescriptionsProps['layout']; } = $props(); let draft = $state(("Draft")); let nativeElement = $state<HTMLDivElement>(); </script> <style> section { display: grid; gap: 12px; min-width: 0; box-sizing: border-box; padding: 16px; border: 1px solid var(--ant-color-border-secondary); border-radius: var(--ant-border-radius-lg); background: var(--ant-color-bg-container); color: var(--ant-color-text); } form { min-width: 0; } </style> {#snippet editor()} <Input aria-label={("" + String((title)) + ": draft")} name="draft" bind:value={draft} /> {/snippet} <section aria-label={(title)}> <form aria-label={("" + String((title)) + ": shape")} onsubmit={event => { event.preventDefault(); }}> <Descriptions id={`descriptions-breakpoints-${id}`} bind:nativeElement title={(title)} {bordered} {layout} column={{ xs: 1, sm: 2, md: 3 }} items={([ { key: 'draft', label: "Draft", children: editor }, { key: 'runtime', label: "Wednesday", children: 'Svelte 5', span: { xs: 1, sm: 1, md: 2 } }, { key: 'language', label: "Language", children: 'TypeScript' }, { key: 'build', label: "Assembly", children: 'Vite' }, { key: 'package', label: "Package", children: '@woodger/antd', span: 'filled' }, { key: 'mode', label: "Mode", children: "Development" }, { key: 'status', label: "Status", children: "Ready" } ])} /> </form> <output aria-label={("" + String((title)) + ": root")}>{(nativeElement ? "Connected" : "Waiting mount")}</output> </section>
API
Examples are checked against the current ant.design page and the public API of the installed package. Full definitions of Props are in @woodger/antd.
| Theme | Example or limitation |
|---|---|
| Basic | Related fields. |
| border | Frame and service status. |
| Custom size | large, medium, small. |
| responsive | Columns by breakpoints. |
| Vertical | Labels above the values. |
| Vertical border | Vertical table with frame. |
| Custom semantic dom styling | General and local styles. |
| row | Full line via span=filled. |
| Property | Description | Type | Default |
|---|---|---|---|
prefixCls | Full prefix of root, header, table and cells. The empty string and undefined use the provider prefix; semantic callbacks receive the original local prop. | string | ConfigProvider.prefixCls + "-descriptions" |
items | Fields with label, children and span. | readonly DescriptionsItem[] | — |
title | Table title: value or Snippet. | DescriptionsContent | — |
extra | Additional action in the header. | DescriptionsContent | — |
column | Number of columns by viewport with thresholds theme.token.screen*. Tokens are inherited and updates queries without remount; before mount fallback is 3. | number | GridResponsive<number> | adaptive 1–4 |
layout | Caption next to a value or a separate line. | horizontal | vertical | horizontal |
bordered | Frames and background of labels. | boolean | false |
colon | Colon in horizontal labels without frame. | boolean | true |
size | large, medium, small; affects indentation. | ComponentSize | context / large |
styles | CSS lines for semantic slots. | DescriptionsSlots | callback | — |
classNames | Classes for semantic slots. | DescriptionsSlots | callback | — |
nativeElement | bind:nativeElement instead of React ref. | HTMLDivElement | — |
DescriptionsItem
key - stable key, label - label, children - value. span accepts a number, filled or map breakpoints. styles/classNames contain label/content; item styles specify general settings. Immutable items can be passed as a readonly array.
ConfigProvider.descriptions
DescriptionsConfig: classstyleclassNamesstyles. class/style - strings, classNames/styles - slots object or function with current props, including allowed column, items and size.
Classes add up. Priority of root styles: defaults.styles.root → defaults.style → local styles.root → local style. The local styles of the remaining slots override the defaults; settings for a specific item specify cell styles. Nested descriptions replaces the entire record, an empty object resets the settings.
Semantic DOM
The root div contains a header with title/extra and a native table. With bordered, labels and values are in separate th/td cells. Without a border, each cell contains a label and a value; vertical separates them into lines.
prefixCls specifies the classes of the root, header/title/extra, view/row and all cells. An empty local prop selects a common provider prefix. Semantic callbacks see the original props.prefixCls, and the namespace of theme variables remains independent. bind:nativeElement keeps the same node when the prefix changes.
Slots: root, header, title, extra, label, content. An element can refine its label/content through its own styles/classNames. Descriptions displays information; For editing, use a separate form, and use real buttons for actions in extra.
Registration tokens
theme.components.Descriptions applies ten component tokens: colors, margin spacing, title padding, and colons. Custom styles and style take precedence over the topic; Element settings refine the overall cell styles. The overall size is set via ConfigProvider.componentSize.
| Token | Purpose |
|---|---|
colonMarginLeft | Indentation before colon. |
colonMarginRight | Indentation after colon. |
contentColor | Color of values. |
extraColor | Color of the additional area. |
itemPaddingBottom | Line indent without border. |
itemPaddingEnd | Space between fields. |
labelBg | Label background in frame. |
labelColor | Label color. |
titleColor | Title color. |
titleMarginBottom | Bottom header indent. |
| Token | Current value |
|---|---|
colorText | rgba(0,0,0,0.88) |
colorTextSecondary | rgba(0,0,0,0.65) |
colorTextHeading | rgba(0,0,0,0.88) |
colorBorderSecondary | #f0f0f0 |
colorFillAlter | rgba(0,0,0,0.02) |
fontSize | 14 |
lineHeight | 1.5714285714285714 |
FAQ
How to stretch a field to the entire line?
Specify span:filled after the completed line. In the middle of the line, filled takes up only the remaining space.
Why did the layout change after mount?
Adaptive maps are selected according to the real viewport. SSR uses fallback; check both server and narrow client layouts.
How to set individual field design?
Use item classNames/styles for label/content. General semantic styles continue to set defaults.
Is Descriptions.Item necessary?
No. In Svelte, fields are set by items, complex values are set by snippets.