Support colors in Avatar component
See original GitHub issueAvatar component has color property, but it doesn’t work. Any color that is passed doesn’t change anything. IMO, it should have the following colours:
- dark
- failure
- gray/info/light
- purple
- success
- warning
- pink
Gray, info and light, if all added, should have different tones, to distinguish them.
I’ve tried to implemented and almost got it to work, so I think whoever picks this should:
- Change
default.ts
and add color styling on ‘avatar’ key value (see snippets below) Avatar.tsx
must extends from Omit instead of PropsWithChildren and have ‘color’ argument passed. It should have another prop calledcolor
with a custom interface that explicit tells the colour options. Addtheme.color[color]
at least on the placeholder HTML element.- Add the custom interface from previous step into
FlowbiteTheme.ts
on avatar key.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
How to Avatar customization in React Avatar component
The avatar comes with default background colour (grey). This can be easily customized to the desired colour by adding custom class or directly...
Read more >Dynamic User Avatar Colour based on Hexadecimal Color
Hi All, I have a list containing a "User Avatar" component for each item (team). Each team has a text attribute containing a...
Read more >Avatar - Lightning Design System
An avatar component represents an object or entity. Person name ... Color, #444444. --slds-c-avatar-initials-inverse-text-color-hover ... Support, dev-ready.
Read more >Avatar – Sanity UI
The Avatar component's color property can be set to either blue , purple , magenta , red , orange , yellow , green...
Read more >Avatar | Components - BootstrapVue
Avatar. Avatars are a BootstrapVue custom component, and are typically used ... as color variant and roundness, and optionally supports acting as a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sldk-yuri you’re welcome! I was checking the original code and almost made it work, so I thought that this was the way to go! Great job!
@rluders @tiagossa1 just did PR. @tiagossa1 thank you for the detailed description and steps, it was a really helpful. I’ve used pallet that was suggested by @tiagossa1 Also I’m going to update docs for Avatar component as well soon.