Skip to content

feat: make avatar size configurable via config.toml#2816

Merged
hayescode merged 4 commits intoChainlit:mainfrom
Br1an67:fix/issue-2743-configurable-avatar-size
Mar 5, 2026
Merged

feat: make avatar size configurable via config.toml#2816
hayescode merged 4 commits intoChainlit:mainfrom
Br1an67:fix/issue-2743-configurable-avatar-size

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 1, 2026

What

Add avatar_size option to [UI] section in config.toml to configure the message avatar size.

Closes #2743

Why

The avatar is hardcoded to 20x20px, making custom logos and detailed avatars difficult to see clearly.

Changes

  • backend/chainlit/config.py: Add avatar_size: Optional[int] = None to UISettings and add commented-out option in TOML template
  • frontend/src/components/chat/Messages/Message/Avatar.tsx: Use config.ui.avatar_size for inline style when set, falling back to default Tailwind classes (h-5 w-5)

Usage

[UI]
avatar_size = 32

Testing

When avatar_size is not set, the avatar renders at the default 20x20px (backward compatible). When set, inline styles override the default.


Summary by cubic

Make message avatar size configurable via config.toml so teams can use larger logos or detailed avatars. Defaults to 20px to keep behavior unchanged.

  • New Features
    • Added [UI].avatar_size (pixels) to config.toml, UISettings, and IChainlitConfig (react-client type updated).
    • Frontend applies config.ui.avatar_size via inline width/height and uses only mt-[3px] when set; otherwise falls back to h-5 w-5 (20px).

Written for commit 3dfe61a. Summary will update on new commits.

Add avatar_size option to [UI] in config.toml. When set, the avatar
renders at the specified pixel size instead of the default 20x20px.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request frontend Pertains to the frontend. labels Mar 1, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@frigidpoetess
Copy link

Thanks a million! I literally just dealt with this issue a couple of days ago, and out of nowhere, here is your solution

@hayescode hayescode added this pull request to the merge queue Mar 5, 2026
Merged via the queue into Chainlit:main with commit ba5262c Mar 5, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request frontend Pertains to the frontend. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Make avatar size configurable

3 participants