Skip to content

Divider Component ​

A divider line that separates content, typically used for the "no more" hint at the bottom of a page

📌 Platform Compatibility ​

APP(vue)H5WeChat Mini ProgramAlipay Mini Program
✔✔✔✔

🏯 Basic Usage ​

html
<!-- Global usage -->
<hy-divider text="Divider"></hy-divider>

Setting a Dashed Line ​

  • Use dashed to specify a dashed line
html
<template>
    <hy-divider text="Moonset" dashed></hy-divider>
</template>

Setting a Hairline ​

  • Use hairline to specify a thin line
html
<template>
    <!-- Thin line -->
    <hy-divider text="Moonset" hairline></hy-divider>
    <!-- Thick line -->
    <hy-divider text="Moonset" :hairline="false"></hy-divider>
</template>

Replacing Text with a Dot ​

  • Use dot to replace the text with a dot
html
<template>
    <hy-divider dot></hy-divider>
</template>

Aligning Text Left or Right ​

  • Use textPosition to align the text to the left or right
    • left: Text aligned left
    • center: Text centered (default)
    • right: Text aligned right
html
<template>
    <hy-divider text="Moonset" textPosition="left"></hy-divider>
    <hy-divider text="Moonset" textPosition="right"></hy-divider>
</template>

Setting Text Color and Line Color ​

  • Use textColor and lineColor to specify the text color and line color
html
<template>
    <hy-divider text="Moonset" textColor="#2979ff" lineColor="#ff0000"></hy-divider>
</template>

API ​

Divider Props ​

ParameterDescriptionTypeDefault
textText contentstring|loadMore| loading|noMore-
dashedWhether to use a dashed linebooleanfalse
hairlineWhether to use a hairline (thin line)booleantrue
dotWhether to replace the text with a dot; takes precedence over the text fieldbooleanfalse
textPositionPosition of the text contentcenter|left|rightcenter
textSizeText size; numeric values default to pxstring | number14
textColorText colorstring#909399
lineColorLine colorstring#dcdfe6
loadingIconIcon for the loading statestringLOADING
loadMoreTextPrompt text before loadingstringLoad more
loadingTextPrompt text while loadingstringLoading...
noMoreTextPrompt text when there is no more contentstringNo more data
marginTopDistance from the previous element; numeric values default to pxstring | number0
marginBottomDistance from the next element; numeric values default to pxstring | number0
customStyleCustom external styles to applyCSSProperties-
customClassCustom external class namestring-

Events ​

Event NameDescriptionCallback Parameters
clickClick event-

CSS Variables ​

VariableDescriptionDefault
--hy-divider-min-heightMinimum height35px
--hy-divider-text-colorText/dot colorFollows --hy-text-color--3
--hy-divider-dot-font-sizeDot font sizeFollows --hy-font-size-sm (24rpx)
12:33
battery