Root Chip là div không tương tác; chỉ nút xoá là button có tên từ deleteLabel.
Element chatty-chip ở mục Standard là chuẩn chatty-ui port theo; các mục theo surface mô tả component React đang chạy.
On this page
Use when / Avoid
Dùng khi cần hiện một giá trị lọc đang chọn và cho gỡ từng giá trị. Chip không có prop selected, không có hành động trên thân chip và không có trạng thái disabled; gợi ý bước tiếp theo trong hội thoại không dùng component này trong source hiện tại.
Use instead
Component
Use when
Chip
Hiện giá trị lọc đang bật kèm nút xoá, như Explorer.
Button
Hành động có kết quả; thân Chip không nhận hành động.
Live preview
Standard
Standard
LightDarkDesktopMobile
Element chatty-chip: variant, size và nút xoá; token admin, không màu merchant.
Show codechatty-chip.element.jsWrap code linesCopy
Prototype (cùng chip.styles.js và ) là chuẩn: chatty-ui port 1:1 các file này, và chatty-ui/custom-elements.json sinh từ chính prototype. Chưa surface nào dùng element thật; các mục theo surface bên dưới mô tả React đang chạy. Knowledge files vẫn chuyển sang Polaris theo Target; preview admin-kb chỉ để xem element dưới token admin.
Element
Element
Module
chatty-chip
@avada/chatty-ui/elements/chip.js
API
Kind
Name
Type
Default
Description
attribute
variant
secondary, tertiary
'tertiary'
tertiary viền (mặc định), secondary nền là trạng thái chọn.
attribute
size
sm, md
'md'
Cỡ chữ và padding.
attribute
removable
boolean
false
Thêm nút xoá ở cuối chip.
attribute
remove-label
string
'Remove'
Tên truy cập của nút xoá.
event
chatty-remove
CustomEvent<void>
–
Nút xoá được kích hoạt; host tự gỡ chip.
event
click
MouseEvent
–
Click native, retarget về host; nút xoá còn bắn chatty-remove.
slot
default
–
–
Chữ của chip.
slot
remove-icon
–
–
Thay glyph × mặc định của nút xoá.
part
base
–
–
Khung pill.
part
label
–
–
Vùng chứa chữ.
part
remove
–
–
Nút xoá native.
css-property
--chatty-chip-background
–
–
Nền theo variant.
css-property
--chatty-chip-color
–
–
Màu chữ.
css-property
--chatty-chip-radius
–
–
Bo góc; mặc định pill.
Admin · Knowledge files
Standard
LightDarkDesktopMobile
Element chatty-chip: variant, size và nút xoá; token admin, không màu merchant.
Show codechatty-chip.element.jsWrap code linesCopy