Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`Avatar`: Add predefined color presets based on `alt` initials

Open
#7,013 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
tailwindcss, typescript
Domain
frontend

Research direction

Look at the Avatar component source in the repository, likely in packages/ui/src/components/Avatar. Examine how the color prop is currently handled and where the alt text is used. Research how to generate a deterministic color from initials (e.g., hash the string). Consider the variant prop proposal and how to integrate with the existing theming system, including user-customized colors. Check for existing tests for Avatar to understand the expected behavior.

Written by the indexing model from the issue text.

Description

triage
Package

v4.x

Description

Currently, we can manually set the color of the Avatar component when using only the alt attribute. It would be useful if the background color were predefined based on the initials.

It would also be better to use a solid background with white or black text instead of a muted background with highlighted text. Maybe variant prop could be useful here - so either solid, soft, outline, etc.

However, I'm not sure how this would work if the user has customized the UI colors, as the avatars may or may not fit well with the adjusted color scheme.

https://mui.com/material-ui/react-avatar/#letter-avatars

Additional context

No response

Dominant language
TypeScript
Stars
7k
Forks
1.1k
Avg merge
1d 17h
Merged PRs (30d)
170

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nuxt/ui

All issues in nuxt/ui

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.