# Avatar
[component-header:sl-avatar]
By default, a generic icon will be shown. You can personalize avatars by adding custom icons, initials, and images. You should always provide a `label` for assistive devices.
```html preview
```
```jsx react
import { SlAvatar } from '@shoelace-style/shoelace/dist/react';
const App = () => ;
```
## Examples
### Images
To use an image for the avatar, set the `image` and `label` attributes. This will take priority and be shown over initials and icons.
```html preview
```
```jsx react
import { SlAvatar } from '@shoelace-style/shoelace/dist/react';
const App = () => (
);
```
### Initials
When you don't have an image to use, you can set the `initials` attribute to show something more personalized than an icon.
```html preview
```
```jsx react
import { SlAvatar } from '@shoelace-style/shoelace/dist/react';
const App = () => ;
```
### Custom Icons
When no image or initials are set, an icon will be shown. The default avatar shows a generic "user" icon, but you can customize this with the `icon` slot.
```html preview
```
```jsx react
import { SlAvatar, SlIcon } from '@shoelace-style/shoelace/dist/react';
const App = () => (
<>
>
);
```
### Shapes
Avatars can be shaped using the `shape` attribute.
```html preview
```
```jsx react
import { SlAvatar, SlIcon } from '@shoelace-style/shoelace/dist/react';
const App = () => (
<>
>
);
```
### Avatar Groups
You can group avatars with a few lines of CSS.
```html preview
```
```jsx react
import { SlAvatar, SlIcon } from '@shoelace-style/shoelace/dist/react';
const css = `
.avatar-group sl-avatar:not(:first-of-type) {
margin-left: -1rem;
}
.avatar-group sl-avatar::part(base) {
border: solid 2px var(--sl-color-neutral-0);
}
`;
const App = () => (
<>
>
);
```
[component-metadata:sl-avatar]