Divider Divider
Separate content with horizontal or vertical dividers and optional text.
Import
Use <hui-divider> with uni-app easycom. Import public types from @nscode/handy-uni. For ordinary Vue 3, install the preview plugin from @nscode/handy-uni/web and register its components.
Examples
Interact with the controls to see values and event results on the page.
<template>
<view>
<hui-divider>分区 / Section</hui-divider>
<hui-divider content-position="left">left</hui-divider
><hui-divider content-position="right" border-style="dashed">right / dashed</hui-divider
><hui-divider border-style="dotted" /><view
><text>A</text><hui-divider direction="vertical" /><text>B</text></view
>
<text>{{ lastEvent }}</text>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const lastEvent = ref('No event yet')
</script>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
direction | "vertical" | "horizontal" | 'horizontal' | Layout direction. |
contentPosition | "left" | "right" | "center" | 'center' | Position of divider text. |
borderStyle | "solid" | "dashed" | "dotted" | 'solid' | Divider line style. |
hairline | boolean | true | Use a hairline divider. |
Root attributes: common props. A Boolean default of undefined supports inheritance; explicit false overrides it. Other Boolean props default to false unless listed otherwise.
When borderStyle="dashed" is combined with hairline, scaling the thin line also reduces the spacing between dashes.
Events
None.
Slots
| Slot | Parameters | Description |
|---|---|---|
default | — | Main content. |
Methods
None.
Types
DividerProps are available from @nscode/handy-uni.
Platform notes
| Behavior | uni-app H5 | WeChat Mini Program | App-vue | Ordinary Vue 3 Web (preview) |
|---|---|---|---|---|
| Basic interaction | Supported; device checks pending | Supported; device checks pending | Supported; device checks pending | Supported by the web platform adapter |
Follow the smoke checklist. Device evidence is tracked separately; unit tests do not establish device acceptance.