AI Mode: CartConfirmation có thể render một dòng hoặc nhóm dòng; View cart gọi onViewCart của caller.
AI Mode: ảnh 80px × 64px, nhãn body-small, quantity và giá cùng một dòng.
Admin: inbox dùng cùng CartConfirmation nhưng không truyền onViewCart cho viewer admin nên không có View cart.
Receipt nằm trong thread và không tự biến mất; hiệu ứng quantity có thời gian riêng.
Element chatty-toast ở mục Standard là chuẩn cho thông báo tạm thời của storefront; receipt trong thread không dùng toast.
On this page
Use when / Avoid
Dùng sau khi hệ thống xác nhận thêm giỏ thành công. Không ghép xác nhận vào văn bản AI và không dùng cho phản hồi tạm thời: receipt nằm lại trong thread. Classic dùng cùng block cho khách.
Use instead
Component
Use when
CartConfirmation
AI Mode: receipt trong danh sách tin nhắn, có View cart.
CartConfirmation
Admin inbox: cùng receipt, không có View cart cho viewer admin.
Live preview
Standard
Standard
LightDarkDesktopMobile
Element chatty-toast: neutral có action, success và critical; token chuẩn.
Show codechatty-toast.element.jsWrap code linesCopy
<chatty-toast style="width: 100%" open duration="0">Message deleted<chatty-button slot="action" variant="plain" size="sm">Undo</chatty-button></chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="success">Added to cart</chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="critical">Couldn't send. Check your connection and try again.</chatty-toast>
Prototype (cùng toast.styles.js và ) là chuẩn cho thông báo tạm thời của storefront: chatty-ui port 1:1 các file này, và chatty-ui/custom-elements.json sinh từ chính prototype. Receipt thêm giỏ trong thread không phải toast; nó là chatty-cart-confirmation ở trang Cart confirmation. Admin giữ App Bridge toast. Chưa surface nào dùng element thật; các mục bên dưới mô tả React đang chạy.
Element
Element
Module
chatty-toast
@avada/chatty-ui/elements/toast.js
API
Kind
Name
Type
Default
Description
attribute
open
boolean
false
Toast đang hiện.
attribute
tone
neutral, critical, success, caution
'neutral'
Ý nghĩa của thông báo: icon đầu dòng màu chữ inverse (không dựa riêng vào màu); critical đổi role sang alert.
attribute
duration
number
6000
Tự đóng sau số ms này; 0 giữ lại; tạm dừng khi hover hoặc focus.
attribute
close-label
string
'Close'
Tên truy cập của nút đóng.
event
click
MouseEvent
–
Click native của nút đóng, nổi ra ngoài shadow root.
event
chatty-close
CustomEvent<{reason: timeout, close-button}>
–
Yêu cầu đóng (timeout hoặc close-button); preventDefault giữ toast.
slot
default
–
–
Nội dung thông báo.
slot
action
–
–
Một action tuỳ chọn, ví dụ Undo.
slot
close-icon
–
–
Icon của nút đóng; mặc định là dấu nhân.
part
base
–
–
Khung toast.
part
icon
–
–
Icon đầu dòng theo tone (critical, success, caution); neutral không có.
part
message
–
–
Vùng chứa thông báo.
part
action
–
–
Vùng chứa action.
part
close
–
–
Nút đóng.
css-property
--chatty-toast-background
–
–
Nền toast.
css-property
--chatty-toast-color
–
–
Màu chữ toast.
AI Mode
Standard
LightDarkDesktopMobile
Element chatty-toast: neutral có action, success và critical; token chuẩn.
Show codechatty-toast.element.jsWrap code linesCopy
<chatty-toast style="width: 100%" open duration="0">Message deleted<chatty-button slot="action" variant="plain" size="sm">Undo</chatty-button></chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="success">Added to cart</chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="critical">Couldn't send. Check your connection and try again.</chatty-toast>
Current (React), being replaced
LightDarkDesktopMobile
Chỉ để so sánh: receipt thêm giỏ, không phải toast; xem trang Cart confirmation. AI Mode có View cart.
Show codetoast-confirmation.jsxWrap code linesCopy
Thêm class chatty-cart-confirmation--no-media; body chiếm cả hai cột
Không đổi
Hover View cart
pointer
Gạch chân 2px (từ 1px)
Native button
Active View cart
pointer down
Gạch chân 3px
Native button
Focus-visible View cart
keyboard
outline 2px solid currentColor, offset 2px
Native focus
Không có View cart
onViewCart undefined
Nút không render
Không đổi
Behaviour
Interaction
Result
Click View cart
Gọi onViewCart của caller; component không tự mở giỏ.
Receipt không hợp lệ
Component trả null, không có card rỗng.
Tiêu đề dài
overflow-wrap anywhere trong body; giá white-space nowrap.
Grouped
Tối đa bốn dòng hiện đầy đủ; nếu nhiều hơn, hiện ba dòng và số còn lại. Admin có thể hiện tất cả.
Quantity thay đổi
Hiệu ứng đánh dấu kết thúc sau 600ms; reduced motion tắt animation.
Copy
String
i18n key
Where
Added to cart
Added to cart
Nhãn card và aria-label; caller truyền t
Quantity in cart
Quantity in cart
Dòng quantity
View cart
View cart
Nút View cart
Source
File
Evidence
API và DOM
Kích thước và token
Caller AI Mode
Token màu AI Mode
Classic
Standard
LightDarkDesktopMobile
Element chatty-toast trên Classic.
Show codechatty-toast.element.jsWrap code linesCopy
<chatty-toast style="width: 100%" open duration="0">Message deleted<chatty-button slot="action" variant="plain" size="sm">Undo</chatty-button></chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="success">Added to cart</chatty-toast>
<chatty-toast style="width: 100%" open duration="0" tone="critical">Couldn't send. Check your connection and try again.</chatty-toast>
Current (React), being replaced
LightDarkDesktopMobile
Snackbar của ChatPage (useSnackbar contained): nền --chatty-tooltip-bg, chữ trắng; token inverse lấy từ đây.
Show codeChatPage.js; useSnackbar.jsWrap code linesCopy