Admin chỉ dùng trong inbox và chỉ light; admin-dark là N/A.
Enter gửi, Shift+Enter xuống dòng; IME composition không gửi. Event chatty-send có {text, attachments}, bubbles và composed; preventDefault giữ draft. Form reset khôi phục value ban đầu. Input font đủ lớn cho iOS.
Textarea tự cao tối đa 5 dòng rồi cuộn. Send là icon button cùng hàng; click Send trả focus về textarea. .sending giữ draft, làm mờ và đặt aria-busy; host clear .value sau khi gửi thành công. .disabled dành cho trạng thái không cho tương tác.
Element
Element
Module
chatty-composer
@avada/chatty-ui/elements/composer.js
API
Kind
Name
Type
Default
Description
attribute
value
string
''
Draft text and form value.
attribute
name
string
'message'
Name used by the enclosing form.
attribute
label
string
'Message'
Accessible input label.
attribute
send-label
string
'Send'
Translated send button text.
attribute
placeholder
string
'Write a message…'
Optional draft hint.
attribute
disabled
boolean
false
Prevents edits and submission while pending.
attribute
sending
boolean
false
Host-owned send in progress; retains and dims the draft without dropping focus.
event
chatty-send
CustomEvent<{text: string, attachments: Array}>
Not available
Nonempty submission; cancel to retain the draft.
event
click
MouseEvent
Not available
Native send button click.
slot
toolbar
Not available
Not available
Suggestion and prefill actions before the typing row.
slot
attachments
Not available
Not available
Selected attachment previews.
part
base
Not available
Not available
Composer container.
part
control
Not available
Not available
Textarea.
part
send
Not available
Not available
Send button.
Classic
Current (React), being replaced
LightDarkDesktopMobile
Component React thật; dữ liệu fixture, không gửi request.
Show codemarkdown.jsxWrap code linesCopy
import React, {useState} from 'react';
import ChatThread from '@scripttag/v2/views/ChatThread.jsx';
import {chatStore} from '@scripttag/v2/stores/chatStore.js';
import {WidgetTextRenderer} from '@assets/pages/InboxManagement/v2/blocks/WidgetTextRenderer.jsx';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
import {MessageFrame} from '@avada/chatty-ui/canonical/MessageFrame.jsx';
import {CanonicalSurface} from '@avada/chatty-ui/canonical/Surface.jsx';
import {PreChatPrompt} from '@avada/chatty-ui/canonical/PreChatPrompt.jsx';
import {Composer} from '@avada/chatty-ui/primitives/Composer.js';
const message = {
id: 'guide-reply',
senderType: 'bot',
text: 'The **canvas tote** is lightweight.',
status: 'sent',
createdAt: '2026-11-23T10:00:00Z',
};
const store = {getState: () => ({messages: [message], loading: false}), subscribe: () => () => {}};
export function Compose() {
return (
<Composer.Root onSubmit={() => {}}>
<label htmlFor="current-message">Message</label>
<Composer.Input>
<textarea id="current-message" style={{fontSize: 16}} />
</Composer.Input>
</Composer.Root>
);
}
Current (React), being replaced
LightDarkDesktopMobile
Classic reply renderer đang ship; dữ liệu fixture cục bộ.
Show codemarkdown.jsxWrap code linesCopy
import React, {useState} from 'react';
import ChatThread from '@scripttag/v2/views/ChatThread.jsx';
import {chatStore} from '@scripttag/v2/stores/chatStore.js';
import {WidgetTextRenderer} from '@assets/pages/InboxManagement/v2/blocks/WidgetTextRenderer.jsx';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
import {MessageFrame} from '@avada/chatty-ui/canonical/MessageFrame.jsx';
import {CanonicalSurface} from '@avada/chatty-ui/canonical/Surface.jsx';
import {PreChatPrompt} from '@avada/chatty-ui/canonical/PreChatPrompt.jsx';
import {Composer} from '@avada/chatty-ui/primitives/Composer.js';
const message = {
id: 'guide-reply',
senderType: 'bot',
text: 'The **canvas tote** is lightweight.',
status: 'sent',
createdAt: '2026-11-23T10:00:00Z',
};
const store = {getState: () => ({messages: [message], loading: false}), subscribe: () => () => {}};
export function ClassicReply() {
return (
<WidgetTextRenderer
text={message.text}
format="markdown"
vm={{...message, senderName: 'Assistant'}}
/>
);
}
Import / element
Component / element
Import / file
Scope root
WidgetTextRenderer
WidgetTextRenderer
Anatomy
Part
Element
1
Reply text and conversation rows
Placement / order
Context
Order
Conversation
Customer question before bot reply
Props
Prop
Type
Values
Default
Notes
Text / messages
Object
Caller supplied
See source
Fixture supplies local conversation
Sizes
Size
Height
Padding
Gap
Radius
Font role (px/rem)
Hit target
Breakpoint / mechanism
Bubble
Content
8px12px self; 7px12px peer
3px grouped; 14px runs
18px; 6px tail
body-medium: 15px/22px desktop, 17px/24px mobile
Not available
80% maximum; AI bot answer unboxed
Tokens
Part
Token
Light
Dark
Text
--chatty-color-text
Theme text
Theme text
States
State
Trigger
Visual change (values)
ARIA/attribute
New reply
Store update
Appended row
Conversation log
Behaviour
Interaction
Result
Render
Shared widget implementation, frozen local fixture
Copy
String
i18n key
Where
Caller supplied
Not available
Message text
Source
File
Evidence
Shipping storefront renderer used in Current preview.
AI Mode
Current (React), being replaced
LightDarkDesktopMobile
ChatThread V2 thật, cùng caller với waiting-streaming.
Show codemarkdown.jsxWrap code linesCopy
import React, {useState} from 'react';
import ChatThread from '@scripttag/v2/views/ChatThread.jsx';
import {chatStore} from '@scripttag/v2/stores/chatStore.js';
import {WidgetTextRenderer} from '@assets/pages/InboxManagement/v2/blocks/WidgetTextRenderer.jsx';
import {Markdown} from '@avada/chatty-ui/primitives/Markdown.js';
import {MessageFrame} from '@avada/chatty-ui/canonical/MessageFrame.jsx';
import {CanonicalSurface} from '@avada/chatty-ui/canonical/Surface.jsx';
import {PreChatPrompt} from '@avada/chatty-ui/canonical/PreChatPrompt.jsx';
import {Composer} from '@avada/chatty-ui/primitives/Composer.js';
const message = {
id: 'guide-reply',
senderType: 'bot',
text: 'The **canvas tote** is lightweight.',
status: 'sent',
createdAt: '2026-11-23T10:00:00Z',
};
const store = {getState: () => ({messages: [message], loading: false}), subscribe: () => () => {}};
export function StorefrontThread() {
const [ready] = useState(() => {
chatStore.setState({
loadedId: 'guide-conversation',
conversation: {id: 'guide-conversation'},
awaitingReply: false,
statusText: '',
messages: [
{
id: 'question',
senderType: 'customer',
text: 'Which bag works for everyday trips?',
blocks: [],
createdAt: new Date('2026-01-15T10:00:00Z'),
},
{
...message,
senderName: 'Assistant',
createdAt: new Date('2026-01-15T10:01:00Z'),
blocks: [],
},
],
});
return true;
});
return ready ? (
<div style={{height: 420, display: 'flex', flexDirection: 'column'}}>
<ChatThread isActive navigate={false} />
</div>
) : null;
}
Import / element
Component / element
Import / file
Scope root
ChatThread
import ChatThread from '@scripttag/v2/views/ChatThread.jsx';
ChatThread
Anatomy
Part
Element
1
Reply text and conversation rows
Placement / order
Context
Order
Conversation
Customer question before bot reply
Props
Prop
Type
Values
Default
Notes
Text / messages
Object
Caller supplied
See source
Fixture supplies local conversation
Sizes
Size
Height
Padding
Gap
Radius
Font role (px/rem)
Hit target
Breakpoint / mechanism
Bubble
Content
10px15px
3px grouped; 14px runs
18px; 6px tail
body-medium: 15px/22px desktop, 17px/24px mobile
Not available
80% maximum; AI bot answer unboxed
Tokens
Part
Token
Light
Dark
Text
--chatty-color-text
Theme text
Theme text
States
State
Trigger
Visual change (values)
ARIA/attribute
New reply
Store update
Appended row
Conversation log
Behaviour
Interaction
Result
Render
Shared widget implementation, frozen local fixture
Copy
String
i18n key
Where
Caller supplied
Not available
Message text
Source
File
Evidence
Shipping storefront renderer used in Current preview.
Admin
Not available — React component tương ứng không có trong surface này; không dựng preview giả.