question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support colors in Avatar component

See original GitHub issue

Avatar 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 called color with a custom interface that explicit tells the colour options. Add theme.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:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tiagossa1commented, Nov 27, 2022

@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!

0reactions
sldk-yuricommented, Nov 25, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found