Ant Design Svelte

Descriptions

Details groups with borders, responsive columns, full rows, snippets and semantic styles.

When to use

Descriptions displays related read-only fields: service parameters, user or order information. It associates a signature with a value and organizes them into strings. For editing use Form, for a homogeneous set of records - Table.

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

Project participant
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.

Service parameters
Name Project API It does not haveStatus Success WorkingRegion Europe
Description The service publishes data for the interface.

Table with frame

Cell borders and label backgrounds separate field names from values.

Order
Number AD-1042Condition Ready to shipDelivery Courier

Dimensions

Switching large, medium and small changes the indents of the table with a frame.

Project environment
Wednesday Svelte 5Language TypeScriptAssembly Vite
Package @woodger/antdDescription 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.

Team
Team
Responsible
Members
Interfaces
Anna Novikova
6 people
Project
Component Library

Vertical labels

In layout=vertical, labels and values ​​occupy separate lines.

Application
NumberAuthorCondition
REQ-204Anna NovikovaUnder review
Comment
Check availability of new components.

Vertical table with frame

Vertical arrangement in combination with bordered.

Own design
Name Ant Design SvelteResponsible Anna NovikovaDescription The local style specifies the general one.

Semantic DOM

General styles and settings for a specific element draw up labels and values.

Project materials
Name Component Library
Wednesday SvelteLanguage TypeScriptLicense 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.

Service status
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.

General settings
LanguageTypeScript
WednesdaySvelte 5

Overall size and colon

Size from ConfigProvider and explicit design of labels via colon.

General settings
Project Ant Design Svelte
Owner Anna
Status Suspended
After reset
ProjectStandard design

Settings Descriptions

General class/style and semantic defaults, local cell styles and nested record reset.

Project parameters
Main area
Project Ant Design Svelte
Draft
Status At work
Sent: —
Independent region
StatusNo changes
General: suite; class: project-details Waiting mount

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.

Service parameters
Name Ant Design SvelteWednesday Svelte 5 / TypeScriptStatus Working
Description Self-hosted component library with themes, RTL and SSR.

Service parameters

Saved review example: switching the frame, vertical layout and responsive columns.

Parent thresholds
Draft Wednesday Svelte 5Language TypeScript
Assembly VitePackage @woodger/antd
Mode DevelopmentStatus Ready
Waiting mount
Legacy thresholds
Draft Wednesday Svelte 5Language TypeScript
Assembly VitePackage @woodger/antd
Mode DevelopmentStatus Ready
Waiting mount
Reset inheritance
Draft Wednesday Svelte 5Language TypeScript
Assembly VitePackage @woodger/antd
Mode DevelopmentStatus Ready
Waiting mount
xs ≤ 639px; sm ≥ 640px; md ≥ 900px

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.

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.

Topics of official examples
ThemeExample or limitation
BasicRelated fields.
borderFrame and service status.
Custom sizelarge, medium, small.
responsiveColumns by breakpoints.
VerticalLabels above the values.
Vertical borderVertical table with frame.
Custom semantic dom stylingGeneral and local styles.
rowFull line via span=filled.
Main parameters Descriptions
PropertyDescriptionTypeDefault
prefixClsFull prefix of root, header, table and cells. The empty string and undefined use the provider prefix; semantic callbacks receive the original local prop.stringConfigProvider.prefixCls + "-descriptions"
itemsFields with label, children and span.readonly DescriptionsItem[]—
titleTable title: value or Snippet.DescriptionsContent—
extraAdditional action in the header.DescriptionsContent—
columnNumber 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
layoutCaption next to a value or a separate line.horizontal | verticalhorizontal
borderedFrames and background of labels.booleanfalse
colonColon in horizontal labels without frame.booleantrue
sizelarge, medium, small; affects indentation.ComponentSizecontext / large
stylesCSS lines for semantic slots.DescriptionsSlots | callback—
classNamesClasses for semantic slots.DescriptionsSlots | callback—
nativeElementbind: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.

Component tokens
TokenPurpose
colonMarginLeftIndentation before colon.
colonMarginRightIndentation after colon.
contentColorColor of values.
extraColorColor of the additional area.
itemPaddingBottomLine indent without border.
itemPaddingEndSpace between fields.
labelBgLabel background in frame.
labelColorLabel color.
titleColorTitle color.
titleMarginBottomBottom header indent.
Common tokens of the current topic
TokenCurrent value
colorTextrgba(0,0,0,0.88)
colorTextSecondaryrgba(0,0,0,0.65)
colorTextHeadingrgba(0,0,0,0.88)
colorBorderSecondary#f0f0f0
colorFillAlterrgba(0,0,0,0.02)
fontSize14
lineHeight1.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.