Customize the chat UI
You customize @ethora/chat-component through the config prop of <Chat> and a few component props. Most visual options can also be saved in the Ethora admin panel and reach open chats without a redeploy.
Where options go
Add appearance keys to the memoized config shared by XmppProvider and Chat (see Add chat to a React app):
const config = useMemo<IConfig>(() => ({
...connection, // appId, baseUrl, xmppSettings, jwtLogin
colorScheme: 'system',
colors: { primary: '#1d4ed8', secondary: '#dbeafe', ownMessageBackground: '#e0e7ff' },
typography: { googleFontsFamily: 'Inter', fontFamily: 'Inter, sans-serif', fontSize: 15 },
backgroundChat: { color: '#f8fafc' },
}), [connection]);Colors, dark mode, background
colorScheme:'light'(default),'dark', or'system'(follows the OS or browser and updates live). It styles only the chat; an app with its own dark mode should pass its resolved value.colors:primaryandsecondaryare required once you setcolors.primarydrives icons and sender names;iconsdefaults toprimary;iconsBgfalls back tosecondary, then white.ownMessageBackground(default#E7EDF9),otherMessageBackgroundandinputBackground(default#FFFFFF) color the bubbles and input bar.- In dark mode
primaryis lightened by about 20% for legibility. Pass a dark-suitableprimaryif you need the exact brand value. Other colors are used as given. backgroundChat:color, andimageas a URL (for aFile, passURL.createObjectURL(file)).
Fonts
typography.fontFamily applies to all chat text. Load the font with googleFontsFamily (URL built for you), googleFontsUrl (full URL, wins over the family) or fontFaces (self-hosted files). fontSize is the base size in px, default 16; all chat text scales from it. weights sets regular, medium, semibold, bold.
typography: {
fontFamily: 'Brand Sans, sans-serif',
fontFaces: [{ family: 'Brand Sans', src: '/fonts/brand-sans.woff2', weight: 400 }],
fontSize: 16,
},Layout toggles
Eight boolean switches hide parts of the UI; each is described in the table below. disableRooms with the roomJID prop gives a single-room chat (Rooms).
Options for AI agents
customTypingIndicator:enabled,text(string or(usersTyping: string[]) => string),position('bottom' | 'top' | 'overlay' | 'floating'),styles, andcustomComponent(props{ usersTyping, text, isVisible }).blockMessageSendingWhenProcessing: after the user sends, sending in that room is blocked until the last message comes from someone else, such as the bot's answer. In the object form,timeout(ms, default 300000) ends the block and callsonTimeout(roomJID).translates:mode: 'auto'shows translations already attached to a message and calls no service.'manual'shows a "Translate" link answered by youronTranslate(text, ctx), or byendpointif you set one (it must allow CORS).readerLocalesets the reader's language from your app.
customTypingIndicator: { enabled: true, position: 'bottom', text: (users) => `${users[0]} is thinking…` },
blockMessageSendingWhenProcessing: { enabled: true, timeout: 60000 },Interface language
i18n.locale takes a BCP-47 tag and uses its base language. Built-in captions: en, fr, es, pt, ht, zh; a missing key falls back to English. i18n.strings overrides captions by key (keys in src/i18n/strings.ts). Without locale, captions follow the language the reader picks in the chat. i18n is separate from translates.
i18n: { locale: 'fr-CA', strings: { 'input.placeholder': 'Écrivez à notre équipe' } },Replace components
These are <Chat> props, not config keys. MessageProps and SendInputProps are exported.
CustomMessageComponent: React.ComponentType<MessageProps>. Props:message(IMessage:id,body,date,user.id,user.name, …),isUser,isReply,isLastInGroup?.CustomInputComponent: React.ComponentType<SendInputProps & { onSendMessage?: (message: string) => void; onSendMedia?: (data: any, type: string) => void; placeholderText?: string }>. The chat passessendMessage(message, mentions?)andsendMedia(data: File[] | File | Blob, type, caption?), the same functions asonSendMessage/onSendMedia, pluseditMessage,isLoading,isMessageProcessing(true while sending is blocked),onFocus/onBlur(send the typing state),config,multiline,focusOnRoomSwitch. It does not passplaceholderText.- Also:
CustomScrollableArea,CustomDaySeparator,CustomNewMessageLabel.
import type { MessageProps } from '@ethora/chat-component';
export function Bubble({ message, isUser }: MessageProps) {
return (
<div style={{ textAlign: isUser ? 'right' : 'left' }}>
<strong>{message.user.name}</strong>
<p>{message.body}</p>
</div>
);
}
// <Chat config={config} CustomMessageComponent={Bubble} />Settings from the admin panel
Admins save colors, fonts, layout switches and AI display options per app under Appearance → Chat. Opt in:
remoteAppearance: { appId }, // baseUrl defaults to config.baseUrlThe chat reads GET /v2/chat-component/config?appId= (public) at start and holds the first paint for at most initialWaitMs (default 2500). Saved values win over the same keys in your config. When an admin saves, a chat-component-config-updated event makes open chats read again and apply the change. A failed read keeps the current look; an offline client gets the change at its next start. To fetch it yourself, use eventHandlers.onChatComponentConfigUpdated({ appId, version }).
The server can set only these keys, each validated: colorScheme, the seven colors keys above, typography.fontFamily, .fontSize, .googleFontsFamily, backgroundChat.color, the eight layout toggles, chatHeaderBurgerMenu, chatHeaderSettings.hideSearch, blockMessageSendingWhenProcessing, customTypingIndicator.enabled/.text/.position, translates.enabled, secondarySendButton.enabled.
Changing the config at runtime
A new config on a mounted <Chat> restyles it in place without reconnecting; rooms, messages, drafts and the session stay. This covers all of colors, typography, backgroundChat and the server keys above. Connection and login keys (appId, baseUrl, xmppSettings, jwtLogin, …) are read at start and take effect on the next mount.
React Native shares the config auth blocks; this page covers web only.
Options reference
| Option | Type | What it does |
|---|---|---|
colorScheme | 'light' | 'dark' | 'system' | Light, dark, or follow the OS. Default 'light'. |
colors | { primary; secondary; icons?; iconsBg?; ownMessageBackground?; otherMessageBackground?; inputBackground? } | Theme, icon, bubble and input colors. |
typography | TypographyConfig | Font family, size, loading, weights. |
backgroundChat | { color?: string; image?: string | File } | Messages area background. |
disableHeader | boolean | Hide the chat header. |
disableRooms | boolean | Hide the room list. |
disableNewChatButton | boolean | Hide the new chat action. |
disableRoomMenu | boolean | Disable the room menu. |
disableUserCount | boolean | Hide "N users" and its online popover. |
disableMedia | boolean | Turn off media sending. |
disableTypingIndicator | boolean | Turn off the typing indicator. |
disableProfilesInteractions | boolean | Turn off profile interactions. |
customTypingIndicator | { enabled; text?; position?; styles?; customComponent? } | Typing indicator text, position, component. |
blockMessageSendingWhenProcessing | boolean | { enabled; timeout?; onTimeout? } | Block sending until a reply or timeout. |
translates | { enabled; mode?; readerLocale?; onTranslate?; endpoint?; … } | Per-message translation. |
i18n | { locale?: string; strings?: Record<string, string> } | Interface language, caption overrides. |
remoteAppearance | { appId: string; baseUrl?: string; initialWaitMs?: number } | Apply admin panel appearance live. |
Next steps
Stuck or planning something bigger?
Book 15 minutes with the team, or open an issue on GitHub. Self-hosting and enterprise questions are welcome.