Classic: link Markdown dùng --chatty-link (merchant --faqsTextColor), fallback #303030 Light, #eee Dark.
AI Mode: --chatty-link trỏ về --link, và --link bằng --vib-1 ở cả hai theme.
Admin: bubble inbox đặt --chatty-link từ --chatty-color-text-link; ngoài scope dùng fallback #2563eb.
Mọi anchor Markdown đều gạch chân bằng inline style và mở tab mới; scheme ngoài allowlist bị đổi thành fragment an toàn.
Element chatty-link ở 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 anchor Markdown cho điều hướng trong nội dung câu trả lời. Thao tác đổi trạng thái (gửi, lưu) dùng Button. Không có component Link độc lập trong chatty-ui: đừng import một tên như vậy.
Use instead
Component
Use when
Markdown
Câu trả lời có link; renderer tạo anchor.
Button
Hành động có kết quả rõ ràng; truyền href thì Button render anchor theo kit đó.
Live preview
Standard
Standard
LightDarkDesktopMobile
Element chatty-link: link ngoài, mailto và fragment.
Show codechatty-link.element.jsWrap code linesCopy
Prototype (cùng link.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.
Element
Element
Module
chatty-link
@avada/chatty-ui/elements/link.js
API
Kind
Name
Type
Default
Description
attribute
href
string
''
URL http, https, mailto, tel, tương đối hoặc fragment; scheme khác render chữ thường.
attribute
target
_blank, _self
''
Để trống thì link ngoài origin mở tab mới với rel noopener noreferrer.
event
click
MouseEvent
–
Kích hoạt native.
slot
default
–
–
Chữ link ở light DOM để index và dịch được.
part
base
–
–
Anchor native.
css-property
--chatty-link-color
–
–
Màu chữ và gạch chân.
Classic
Standard
LightDarkDesktopMobile
Element chatty-link: link ngoài, mailto và fragment.
Show codechatty-link.element.jsWrap code linesCopy
Cùng tab và scheme không an toàn render chữ thường.
Show codechatty-link.element.jsWrap code linesCopy
<chatty-link href="https://example.com/faq" target="_self">FAQ in the same tab</chatty-link>
<chatty-link href="javascript:alert(1)">Unsafe scheme renders text</chatty-link>
Current (React), being replaced
LightDarkDesktopMobile
Markdown thật với link; anchor lấy màu từ `--chatty-link` của Classic.
Show codelink.jsxWrap code linesCopy
import React from 'react';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
export function Answer() {
return <Markdown text="Read our [delivery policy](https://example.com/delivery) before ordering." />;
}
Current (React), being replacedDoShow codelink.jsxWrap code linesCopy
import React from 'react';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
export function Answer() {
return <Markdown text="Read our [delivery policy](https://example.com/delivery) before ordering." />;
}
Viết link có nghĩa trong câu; giữ gạch chân mặc định của anchor.
Cùng tab và scheme không an toàn render chữ thường.
Show codechatty-link.element.jsWrap code linesCopy
<chatty-link href="https://example.com/faq" target="_self">FAQ in the same tab</chatty-link>
<chatty-link href="javascript:alert(1)">Unsafe scheme renders text</chatty-link>
Current (React), being replaced
LightDarkDesktopMobile
Markdown thật trong scope AI Mode.
Show codelink.jsxWrap code linesCopy
import React from 'react';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
export function Answer() {
return <Markdown text="Read our [delivery policy](https://example.com/delivery) before ordering." />;
}
Import / element
Component / element
Import / file
Scope root
Markdown
@avada/chatty-ui/primitives
.chatty-ai-mode[data-theme]
Anatomy
Part
Element
1
Native a từ Markdown, trong .aimode-chat.
2
Rule a của thread lặp lại màu và gạch chân.
Placement / order
Context
Order
Tin nhắn chat
Markdown render nội dung tin nhắn, bọc trong ClampFade.
Props
Prop
Type
Values
Default
Notes
text
string
Markdown
empty
Nội dung đã làm mượt khi streaming.
onLinkClick
function
href, event
undefined
Caller truyền để theo dõi link trong câu trả lời.
Sizes
Size
Height
Padding
Gap
Radius
Font role (px/rem)
Hit target
Breakpoint / mechanism
Inline
Theo dòng
Không khai báo
Không khai báo
Không khai báo
Kế thừa chữ cha
Native inline box
Không override theo viewport
Tokens
Part
Token
Light
Dark
Link color
--chatty-link
var(--link)
var(--link)
Link role
--link
var(--vib-1)
var(--vib-1)
Text
--vib-1
rgba(20,19,24,0.94)
rgba(255,255,255,0.96)
States
State
Trigger
Visual change (values)
ARIA/attribute
Default
render
--link color, underline 1px, offset 2px
Native link
Hover
pointer
Không có rule riêng
Native
Behaviour
Interaction
Result
Link ngoài
target="_blank" và rel="noopener noreferrer".
Sync màu
Markdown đặt màu inline nên --chatty-link và a phải khớp nhau.
Copy
String
i18n key
Where
Link label
Caller-owned
Nội dung do câu trả lời cung cấp
Source
File
Evidence
Biến link của AI Mode
Caller Markdown
Admin
Standard
LightDarkDesktopMobile
Element chatty-link: link ngoài, mailto và fragment.
Show codechatty-link.element.jsWrap code linesCopy
Cùng tab và scheme không an toàn render chữ thường.
Show codechatty-link.element.jsWrap code linesCopy
<chatty-link href="https://example.com/faq" target="_self">FAQ in the same tab</chatty-link>
<chatty-link href="javascript:alert(1)">Unsafe scheme renders text</chatty-link>
Current (React), being replaced
LightDarkDesktopMobile
Markdown thật trong frame Admin; `--chatty-link` chưa được frame đặt nên anchor dùng fallback.
Show codelink.jsxWrap code linesCopy
import React from 'react';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
export function Answer() {
return <Markdown text="Read our [delivery policy](https://example.com/delivery) before ordering." />;
}
Import / element
Component / element
Import / file
Scope root
Markdown
@avada/chatty-ui/primitives
.inbox-v2
Anatomy
Part
Element
1
Native a từ Markdown trong class chatty-text--markdown.
Placement / order
Context
Order
Tin nhắn bot
Bot markdown render bằng Markdown; tin khác dùng TextRenderer.
Props
Prop
Type
Values
Default
Notes
text
string
Markdown
empty
Caller truyền text của tin nhắn.
className
string
CSS classes
Caller
Caller truyền chatty-textchatty-text--markdown.
Sizes
Size
Height
Padding
Gap
Radius
Font role (px/rem)
Hit target
Breakpoint / mechanism
Inline
Theo dòng
Không khai báo
Không khai báo
Không khai báo
Kế thừa chữ cha
Native inline box
Không override theo viewport
Tokens
Part
Token
Light
Dark
Link color
--chatty-link
var(--chatty-color-text-link, #005bd3) trong bubble self