Key rules
chatty-dividerkhai báo 3 attribute, 0 property không có attribute, 0 event, 1 slot, 2 part và 2 CSS custom property.- Import 1 module
@avada/chatty-ui/elements/divider.jslà definechatty-divider; chunk chỉ import element nó dùng. Prototype chuẩn: trong guide. - Đổi tên attribute, event, slot, part hay CSS custom property là đổi API: diff của custom-elements.json phải có trong 1 MR.
On this page
Overview
A hairline between blocks or a centered day pill, with optional slotted text. Class ChattyDivider.
Attributes
| Name | Property | Type | Default | Description |
|---|---|---|---|---|
orientation |
orientation |
'horizontal' | 'vertical' |
'horizontal' |
Horizontal hairline or vertical rule. |
variant |
variant |
'line' | 'pill' |
'line' |
Hairlines or a centered day pill (horizontal only). |
label |
label |
string |
'' |
Accessible name of the separator, e. |
Properties
Attributes also expose the properties listed in the Property column above.
Not declared in the manifest.
Events
Not declared in the manifest.
Slots
| Name | Description |
|---|---|
| default | Optional horizontal label, between hairlines or inside the day pill. |
Parts
| Name | Description |
|---|---|
base |
Separator box. |
label |
Text wrapper; hidden when the slot is empty. |
CSS custom properties
| Name | Default | Description |
|---|---|---|
- |
– | Hairline colour. |
- |
– | Block margin around a horizontal divider (inline for vertical). |
Usage
import '@avada/chatty-ui/tokens/tokens.css';
import '@avada/chatty-ui/elements/divider.js';
<chatty-divider style="inline-size:100%"></chatty-divider>
<chatty-divider label="Today" style="inline-size:100%">Today</chatty-divider>
<chatty-divider orientation="vertical" style="block-size:24px"></chatty-divider>
Live preview
Component thật dùng cùng story với trang component; dữ liệu mẫu nằm trong frame cục bộ.
Default: trạng thái mặc định và nội dung mẫu của element.
Show code
<chatty-divider style="inline-size:100%"></chatty-divider>
<chatty-divider label="Today" style="inline-size:100%">Today</chatty-divider>
<chatty-divider orientation="vertical" style="block-size:24px"></chatty-divider>Các variant hoặc state chính đặt cạnh nhau trong cùng ví dụ.
Show code
<chatty-divider variant="pill" label="Today" style="inline-size:100%"
>Today</chatty-divider
>Anatomy
Số trong hình khớp bảng bên dưới. Phần chỉ hiện ở state khác được ghi Not shown; ví dụ không thêm phần tử giả.
Anatomy: một instance mặc định riêng, có khoảng trống quanh các phần được đánh số.
Show code
<chatty-divider style="inline-size:100%"></chatty-divider>
<chatty-divider label="Today" style="inline-size:100%">Today</chatty-divider>
<chatty-divider orientation="vertical" style="block-size:24px"></chatty-divider>| Part | Element | Source |
|---|---|---|
| 1 | CSS part base |
chatty- |
| 2 | CSS part label |
chatty- |
Keyboard
No element-specific keys.
Source
- chatty-ui/custom-elements.json