Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
UserAvatar is a component that displays a colored avatar with either the first letter or a greek later if no name is passed. The color is automatically generated based on the name, but can be customized using either HSL values or hue.
The most basic usage is to pass a name to the component:
UserAvatar comes in two sizes: small (1.75rem/28px) and medium (2rem/32px).
You can customize the color using either a hue value or HSL string
For anonymous user we show a random greek letter:
Common use case showing multiple avatars with automatically generated colors:
Name | Description | Default | Control |
---|---|---|---|
name | Name to display in the avatar, empty will show random greek letter string | "" | |
className | Additional CSS classes string | - | |
color | Custom color configuration using hue value (0-360) or HSL string { hue: number } | { hsl: string } | - | |
size | Size of the avatar smallmedium | medium | |
capitalize | Whether to capitalize the letter boolean | true | |
as | Custom element type ElementType | - |