Skip to content

Better Avatar component #4862

Description

@azizbecha

Is your feature request related to a problem? Please describe.
The current Avatar component(s) do the job, but they can do it better. Handling Avatar.Image and Avatar.Text is painful with if/else since it doesn't support fallback.

Describe the solution you'd like
A small refactor to the Avatar component to support Image mainly, and fallback to Text

Example:

<Avatar>
  <AvatarImage src="https://github.com/paper.png" />
  <AvatarFallback>P</AvatarFallback>
</Avatar>

Describe alternatives you've considered
Manually checking for image loading, if it fails then I need to render Avatar.Text instead.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions