Key rules
chatty-carousel-dotskhai báo 2 attribute, 0 property không có attribute, 0 event, 0 slot, 3 part và 2 CSS custom property.- Import 1 module
@avada/chatty-ui/elements/carousel-dots.jslà definechatty-carousel-dots; 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
Decorative position marks under a carousel: count dots, the one at active stretched. Hidden from assistive technology; the carousel itself names the position and owns the controls. Class ChattyCarouselDots.
Attributes
| Name | Property | Type | Default | Description |
|---|---|---|---|---|
count |
count |
number |
0 |
Number of dots (slides). |
active |
active |
number |
0 |
Zero- |
Properties
Attributes also expose the properties listed in the Property column above.
Not declared in the manifest.
Events
Not declared in the manifest.
Slots
Not declared in the manifest.
Parts
| Name | Description |
|---|---|
base |
Dot row. |
dot |
Each dot; the active one also has part active. |
active |
The active dot. |
CSS custom properties
| Name | Default | Description |
|---|---|---|
- |
– | Dot ink; inactive dots mix it at 24%. |
- |
– | Width of the active dot. |
Usage
import '@avada/chatty-ui/tokens/tokens.css';
import '@avada/chatty-ui/elements/carousel-dots.js';
<chatty-carousel-dots style="width: 100%" count="5" active="0"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="3" active="1"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="8" active="7"></chatty-carousel-dots>
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-carousel-dots style="width: 100%" count="5" active="0"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="3" active="1"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="8" active="7"></chatty-carousel-dots>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-carousel-dots style="width: 100%" count="5" active="0"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="3" active="1"></chatty-carousel-dots>
<chatty-carousel-dots style="width: 100%" count="8" active="7"></chatty-carousel-dots>| Part | Element | Source |
|---|---|---|
| 1 | CSS part base |
chatty- |
| 2 | CSS part dot |
chatty- |
| 3 | CSS part active |
chatty- |
Keyboard
No element-specific keys.
Source
- chatty-ui/custom-elements.json