Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Containers

  • Layout
  • AdminLayout
  • SettingsLayout
  • ScrollArea
  • Viewport
  • Resizable
  • AspectRatio
  • FitScreen
  • PreviewSandbox
  • Masonry
  • Container
  • AccentScope

Arrangement

  • Stack
  • Grid
  • Spacer
  • Divider
  • Separator

Divider

divider

Separates content with optional text, alignment, dashed styling, or vertical orientation.

Usage

Basic usage

Do not pass children, which is a pure horizontal dividing line that separates the upper and lower sections of content.

Previous paragraph

Next paragraph

tsx
<p>Previous paragraph</p>
<Divider />
<p>Next paragraph</p>

With text/text position

Pass in children to embed text, and orientation to control text on the left/center/right.

Centered title
Latest updates
More
tsx
<Divider>Centered title</Divider>
<Divider orientation="left">Latest Update</Divider>
<Divider orientation="right">More</Divider>

Dashed line

dashed Switch to dotted line, pure line and with text are both effective.

Dotted line separation
tsx
<Divider dashed />
<Divider dashed>Dotted line separation</Divider>

Regular font weight

plain Let the embedded text use regular font weight (one step bolder by default).

Regular weight title
tsx
<Divider plain>Regular weight title</Divider>

Inline vertical separation

type="vertical" Draw vertical lines between elements embedded in a row.

DocumentationComponentsAbout
tsx
<div className="flex items-center text-sm">
  <span>Documentation</span>
  <Divider type="vertical" />
  <span>Component</span>
  <Divider type="vertical" />
  <span>About</span>
</div>

When to use

Use Divider when a separator needs an embedded label such as "Latest updates" or "More," a dashed style, or an inline vertical line. Use Separator for an unlabeled geometric boundary with ARIA role="separator"; Divider is content-oriented, while Separator provides structural semantics.

Import

ts
import { Divider } from "@hulianui/ui"

Props

NameTypeDefaultDescription
type"horizontal" | "vertical""horizontal"direction. vertical is an inline separation (embedded between a line of text/elements)
orientation"left" | "center" | "right""center"Horizontal position of embedded text (only effective when horizontal + text is present)
dashedbooleanfalsedotted line
plainbooleanfalseRegular font weight for text (one bold step by default)
classNamestring-Extra class name

Slots

SlotTypeDescription
childrenReactNodeText embedded in the separator; if not passed, it will be a pure separator

Usage guidelines

orientation affects label placement only when type="horizontal" has children. A type="vertical" divider is an inline line whose height follows the parent line; place it inside a flex row.

Related

Stack · Grid · Spacer · Separator · Layout · AdminLayout

Playground

Separate headers
<Divider orientation="center">Separate headers</Divider>
PreviousSpacerLayoutNextSeparator

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Usage guidelines
    • Related
  • Playground