Ant Design Svelte

Divider

Content separators: direction, label, spacing and design.

When to use

Divider separates parts of a document or activity on a single line. A horizontal line separates blocks and may have a caption, a vertical line separates adjacent links and buttons. For even spacing without a line, use Space or Flex.

The separator signature does not replace the document title: content creates a regular span. Keep the h2/h3 structure separate.

Line and signature

orientation selects horizontal/vertical and takes precedence over vertical. children specifies the text, number, or Svelte snippet of the horizontal line caption; in vertical mode the signature is not displayed.

Problem Setting Example
Split paragraphs Horizontal Divider Horizontal separator
Add signature children, titlePlacement Separator with signature
Change distance between blocks size Indent size
Split actions in line orientation="vertical" Vertical division
Change line appearance variant Line options

titlePlacement=start/end follows the direction of the text; center places the signature in the middle. RTL example shows logical edges. plain leaves the usual signature design in place of the more prominent separator text.

size controls the vertical padding of the horizontal divider, not the line thickness. The local size takes precedence over the ConfigProvider's explicitly specified global size. variant selects solid/dashed/dotted; dashed also includes a dashed line.

Design and theme

Root has role=separator and aria-orientation. Without a signature, it simultaneously serves as a line; with the signature two rail and content appear. For line thickness and color, use styles.rail, taking into account both parts of it.

classNames/styles accept an object or function from info.props; styles contains CSS strings. Allowed orientation, titlePlacement and size are available in callback. Semantic slots show spot decoration without changing the content.

ConfigProvider.divider inherits class, style, classNames and styles. A nested record replaces the corresponding parent object; local styles are applied after inherited ones. theme.components.Divider is connected to the component: orientationMargin sets the fraction of the distance to the edge, textPaddingInline — the caption indent, verticalMarginInline — the intervals of the vertical divider.

bind:nativeElement returns the root div after mount. The separator itself is not an action or keyboard focus point; buttons and links inside their own snippet retain their semantics.

prefixCls specifies the full local CSS prefix and takes precedence over ConfigProvider.prefixCls. The empty string and undefined inherit a common prefix with the suffix -divider, defaulting to ant-divider. CSS variables, common marker and semantic slots names are preserved. Example ConfigProvider shows inheritance along with Flex and Segmented.

Divider uses design tokens from the current theme for its appearance.

Examples

First, select the components for your interface.

Then customize the theme and check availability.

The examples use the public package @woodger/antd.

Horizontal divider

A line separates paragraphs in a document; dashed is retained as a compatible way to specify dashes.

Separator with label

titlePlacement specifies the logical start, center, or end. The label may be Svelte snippet.

small

Next paragraph

medium

Next paragraph

large

Next paragraph

Indent size

small, medium and large change the vertical spacing of the horizontal line, not its thickness.

Plain label text

plain removes the header design. The switch allows you to compare both types of one label.

Contacts Overview Project settings

Vertical split

A vertical line separates short actions in a line. The children text is not displayed when vertical.

Line options

Solid, dashed and dotted lines with and without label.

Semantic slots

root, rail and content are issued separately. The styles function receives normalized props, including the position of the label.

Text direction

Boolean start follows the direction of ConfigProvider. Switching does not require changing the titlePlacement.

A separator separates content and inherits the theme, size and direction.

OverviewMembersSettings

Project sections

The original review example retains the choice of position, line and text design.

API

Themes of the ant.design live page are mapped to the public API of the installed package. Full definitions of Props are in @woodger/antd.

Topics of official examples
ThemeExample or limitation
HorizontalRegular and dashed line between paragraphs.
Divider with titleStart, center, end and snippet.
Set the spacing size of the dividerThree intervals.
Text without heading styleSwitching plain.
VerticalActions in line.
Variantsolid/dashed/dotted.
Custom semantic dom stylingWorking design of slots.
Divider main parameters
PropertyDescriptionTypeDefault
prefixClsFull local CSS prefix. The empty string inherits the common prefix; ant-divider is used without configuration. Semantic slots and CSS variables preserve names.stringConfigProvider + -divider
orientationLine direction. The position of the label is set via titlePlacement.horizontal | verticalhorizontal
verticalShort record of vertical direction. Explicit orientation takes precedence.booleanfalse
titlePlacementstart/end follow direction; left/right remain physical sides.start | center | end | left | rightcenter
childrenHorizontal line label.Snippet | string | number | null | false—
sizeVertical margins of the horizontal separator.small | medium | largeFrom ConfigProvider
variantLine view. dashed=true also includes dashes.solid | dashed | dottedsolid
plainLabel without title design.booleanfalse
classNamesThe root, rail and content classes.DividerSemanticSlots | function—
stylesCSS lines for the same slots. The function receives info.props.DividerSemanticSlots | function—
nativeElementbind:nativeElement for the root element.HTMLDivElement—

Semantic DOM

root - div with role="separator" and aria-orientation. With the label inside there are two lines rail and span content. Without root label, rail simultaneously serves. The vertical separator does not output content.

classNames/styles accept an object or function from info.props. ConfigProvider.divider inherits class/style and semantic slots; local styles take precedence. direction and the explicitly specified overall size are also inherited.

Registration tokens

Component tokens orientationMargin (fraction of distance to edge), textPaddingInline and verticalMarginInline are applied via theme.components.Divider. Local styles specify the design after the theme and provider settings.

Common tokens of the current topic
TokenCurrent value
colorSplitrgba(5,5,5,0.06)
colorTextrgba(0,0,0,0.88)
colorTextHeadingrgba(0,0,0,0.88)
fontFamily-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSize14
fontSizeLG16
lineHeight1.5714285714285714
lineWidth1
margin16
marginLG24
marginXS8

FAQ

Why doesn't size make the line thicker?

size changes the indentation. Set the thickness via styles.rail; when signing, it is applied to two lines.

How to position a signature taking into account RTL?

Use titlePlacement=start/end. The logical edge follows the direction of the text.

Does the caption replace the section heading?

No, content is a regular span. Specify document headings separately.