Hello! I am styled using your active Material UI theme. Try sending a message.
Chat - Custom theme
Retheme the entire chat surface by wrapping ChatBox in a ThemeProvider with custom palette and shape values.
ChatBox inherits its visual design from the active Material UI theme.
This demo shows how a single createTheme call changes bubble colors, border radius, and typography across the entire surface.
ThemeProviderwith a custompalette.primary(teal) applied to user message bubbles- Custom
shape.borderRadiusreflected in bubble and container rounding - Custom
typography.fontFamilypropagated to all text elements - No extra CSS or style overrides needed — the theme drives everything
Press Enter to start editing
How theme tokens map to chat elements
| Theme token | Chat element |
|---|---|
palette.primary.main |
User message bubble background |
palette.primary.contrastText |
User message bubble text |
palette.grey[100] / grey[800] |
Assistant bubble background (light/dark) |
palette.text.primary |
Assistant bubble text |
palette.divider |
Borders, separators |
shape.borderRadius |
Bubble corner rounding |
typography.body2 |
Message text |
typography.caption |
Timestamps, metadata |
Implementation notes
- Wrapping with
ThemeProviderscopes the theme to that subtree. Other parts of the page keep the parent theme. - Use
CssBaselineinside theThemeProviderif you need baseline styles applied to the chat container. - The
@mui/x-chat/themeAugmentationimport adds TypeScript types forMuiChatBoxand related component overrides increateTheme.
See also
- Slot overrides to replace individual subcomponents rather than styling through the theme
- Customization for the full reference of style override keys