Avatar
Avatar is an image that represents a user or organization.
On this page
v0.32.0BetaNot reviewed for accessibility
Description
Avatar
can be used to represent users and organizations on GitHub.
- Use the default circle avatar for users, and the square shape for organizations or any other non-human avatars.
- By default,
Avatar
will render a static<img>
. To haveAvatar
function as a link, set thehref
which will wrap the<img>
in a<a>
. - Set
size
to update the height and width of theAvatar
in pixels. - To stack multiple avatars together, use AvatarStack.
Accessibility
Images should have text alternatives that describe the information or function represented.
If the avatar functions as a link, provide alt text that helps convey the function. For instance,
if Avatar
is a link to a user profile, the alt attribute should be @kittenuser profile
rather than @kittenuser
.
Learn more about best image practices (WAI Images)
Arguments
Name | Type | Default | Description |
---|---|---|---|
src | String | N/A | The source url of the avatar image. |
alt | String |
| Passed through to alt on img tag. |
size | Integer |
| One of |
shape | Symbol |
| Shape of the avatar. One of |
href | String |
| The URL to link to. If used, component will be wrapped by an |
system_arguments | Hash | N/A |