Avatar
Avatar component is used to represent people or objects. It can also be used to provide additional visual information about a user. It supports images, SVGs and lettered initials. Avatar renders its background color if image size is smaller.
Avatar is compatible with raster images, SVG or @asphalt-react/iconpack
Usage
import Avatar from "@asphalt-react/avatar"
function App() {
return (
<Avatar>
<img
src="images/avatar.png"
alt="dummy avatar"
aria-label="dummy avatar"
/>
</Avatar>
)
}
Props
children
Image or letters to display
type | required | default |
---|---|---|
node | true | N/A |
size
Renders the Avatar with the provided size. accepts xxs, xs, s, m, l sizes.
type | required | default |
---|---|---|
enum | false | "m" |