Back to Ant Design

Divider

components/divider/index.en-US.md

6.3.72.7 KB
Original Source

When To Use

  • Divide sections of an article.
  • Divide inline text and links such as the operation column of table.

Examples

<!-- prettier-ignore -->

<code src="./demo/horizontal.tsx">Horizontal</code> <code src="./demo/with-text.tsx">Divider with title</code> <code src="./demo/size.tsx" version="5.25.0">Set the spacing size of the divider</code> <code src="./demo/plain.tsx">Text without heading style</code> <code src="./demo/vertical.tsx">Vertical</code> <code src="./demo/customize-style.tsx" debug>Style Customization</code> <code src="./demo/component-token.tsx" debug>Component Token</code> <code src="./demo/variant.tsx">Variant</code> <code src="./demo/style-class.tsx" version="6.0.0">Custom semantic dom styling</code>

API

Common props ref:Common props

PropertyDescriptionTypeDefaultVersion
childrenThe wrapped titleReactNode-
classNameThe className of containerstring-
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-
dashedWhether line is dashedbooleanfalse
orientationWhether line is horizontal or verticalhorizontal | verticalhorizontal-
orientationMarginThe margin-left/right between the title and its closest border, while the titlePlacement should not be center, If a numeric value of type string is provided without a unit, it is assumed to be in pixels (px) by default.string | number-
plainDivider text show as plain stylebooleantrue4.2.0
styleThe style object of containerCSSProperties-
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-
sizeThe size of divider. Only valid for horizontal layoutsmall | medium | large-5.25.0
titlePlacementThe position of title inside dividerstart | end | centercenter-
typeThe direction type of dividerhorizontal | verticalhorizontal-
variantWhether line is dashed, dotted or soliddashed | dotted | solidsolid5.20.0
verticalOrientation, Simultaneously configure with orientation and prioritize orientationbooleanfalse-

Semantic DOM

<code src="./demo/_semantic.tsx" simplify="true"></code>

Design Token

<ComponentTokenTable component="Divider"></ComponentTokenTable>