1. Ethora
  2. Docs
  3. Customize the UI

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):

ChatPage.tsx
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: primary and secondary are required once you set colors. primary drives icons and sender names; icons defaults to primary; iconsBg falls back to secondary, then white. ownMessageBackground (default #E7EDF9), otherMessageBackground and inputBackground (default #FFFFFF) color the bubbles and input bar.
  • In dark mode primary is lightened by about 20% for legibility. Pass a dark-suitable primary if you need the exact brand value. Other colors are used as given.
  • backgroundChat: color, and image as a URL (for a File, pass URL.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.

ChatPage.tsx
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, and customComponent (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 calls onTimeout(roomJID).
  • translates: mode: 'auto' shows translations already attached to a message and calls no service. 'manual' shows a "Translate" link answered by your onTranslate(text, ctx), or by endpoint if you set one (it must allow CORS). readerLocale sets the reader's language from your app.
ChatPage.tsx
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.

ChatPage.tsx
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 passes sendMessage(message, mentions?) and sendMedia(data: File[] | File | Blob, type, caption?), the same functions as onSendMessage/onSendMedia, plus editMessage, isLoading, isMessageProcessing (true while sending is blocked), onFocus/onBlur (send the typing state), config, multiline, focusOnRoomSwitch. It does not pass placeholderText.
  • Also: CustomScrollableArea, CustomDaySeparator, CustomNewMessageLabel.
Bubble.tsx
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:

ChatPage.tsx
remoteAppearance: { appId }, // baseUrl defaults to config.baseUrl

The 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

OptionTypeWhat 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.
typographyTypographyConfigFont family, size, loading, weights.
backgroundChat{ color?: string; image?: string | File }Messages area background.
disableHeaderbooleanHide the chat header.
disableRoomsbooleanHide the room list.
disableNewChatButtonbooleanHide the new chat action.
disableRoomMenubooleanDisable the room menu.
disableUserCountbooleanHide "N users" and its online popover.
disableMediabooleanTurn off media sending.
disableTypingIndicatorbooleanTurn off the typing indicator.
disableProfilesInteractionsbooleanTurn off profile interactions.
customTypingIndicator{ enabled; text?; position?; styles?; customComponent? }Typing indicator text, position, component.
blockMessageSendingWhenProcessingboolean | { 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.