WUI logo

Avatar

Allows user to get an avatar with initials as a fallback letter when have no image.

version

5.12.0

install

yarn add @welcome-ui/avatar

usage

import { Avatar } from '@welcome-ui/avatar'

With image #

We use Shape component. You can use size from theme or override with w and h size.

Without image #

Without image we add initials on the avatar with property name. We get by default ramdom color from sub colors to create the background, based on the name string. You can override with color. Font size is calculated automatically and can be override with fontSizeproperty.

With shape square #

By default Avatar is a circle shape, change with property shape.

Properties #

NameType(s)DefaultRequired
color
any
getInitials
(name: string) => string
name
string
size
"sm"
"md"
"lg"
"xl"
"xxl"
src
string
shape
"circle"
"square"

Packages #

Dependencies #
Peer dependencies #

Previous

Accordion

Next

Badge