feat(Avatar): add icon prop as fallback

This commit is contained in:
Benjamin Canac
2023-08-04 11:32:17 +02:00
parent eb609b13e4
commit df3b2028ed
3 changed files with 73 additions and 24 deletions

View File

@@ -51,9 +51,25 @@ baseProps:
### Placeholder
If there is an error loading the `src` of the avatar or `src` is null a background placeholder will be displayed, customizable in `ui.avatar.background`.
If there is an error loading the `src` of the avatar or `src` is null / false a background placeholder will be displayed, customizable in `ui.avatar.background`.
If there's an `alt` prop initials will be displayed on top of the background, customizable in `ui.avatar.placeholder`.
#### Icon
You can use the `icon` prop to display an icon on top of the background, customizable in `ui.avatar.icon`.
::component-card
---
props:
icon: 'i-heroicons-photo'
size: 'sm'
excludedProps:
- icon
---
::
#### Alt
Otherwise, a placeholder will be displayed with the initials of the `alt` prop, customizable in `ui.avatar.placeholder`.
::component-card
---