Skip to content
Latestv1.0.60

Divider

A divider line to separate content.

Basic Usage

Separate paragraphs of text in different sections.

Basic Usage

Custom Content

You can customize the text content on the divider line.

Custom Content

Vertical Divider

Use direction="vertical" to create a vertical divider.

Vertical Divider

Dashed Line

Set border-style="dashed" to present a dashed line.

Dashed Line

Custom Color and Thickness

Use color and border-width attributes to customize the color and thickness of the divider.

Custom Color and Thickness

Use in Nuxt

The Divider component fully supports Nuxt 3/4 environments. As a purely presentational component, its HTML structure is generated directly on the server, achieving perfect visual separation on the first screen with inline or external stylesheets.

Use in Nuxt

SSR Notes:

  • ✅ Horizontal and vertical directions are generated correctly on the server.
  • ✅ Content position is correctly positioned during the SSR phase.
  • ✅ Dashed/dotted styles and custom thickness take effect on the server via styles.
  • ✅ Auto-import feature makes the development experience more pleasant.

Performance Tip

Since the Divider component has a minimalist structure, it generates almost no extra JS payload in SSR scenarios, making it ideal for content-heavy Nuxt pages that prioritize loading speed.

API

Props

PropDescriptionTypeDefault
directionDivider direction'horizontal' | 'vertical''horizontal'
content-positionContent position'left' | 'center' | 'right''center'
border-styleDivider border style'solid' | 'dashed' | 'dotted' | 'double''solid'
border-widthDivider border widthstring | number1px
colorDivider colorstring

Slots

Slot NameDescription
defaultContent text of the divider

Events

This component does not expose component events.

Expose

This component does not expose public instance methods or properties.

Theme Variables

VariableDescriptionDefault
--yh-divider-border-colorDivider border colorvar(--yh-border-color-lighter)
--yh-divider-border-widthDivider border width1px
--yh-divider-border-styleDivider border stylesolid
--yh-divider-margin-horizontalHorizontal margin24px 0
--yh-divider-margin-verticalVertical margin0 8px
--yh-divider-text-colorContent text colorvar(--yh-text-color-primary)

Type Exports

NameDescription
YhDividerPropsComponent props type
YhDividerInstanceComponent instance type

Released under the MIT License.