Avatar
Loading example…
Avatar is part of the Atoms set, imported from @jcsoftdev/ui/atoms.
Import
Section titled “Import”import { Avatar } from "@jcsoftdev/ui/atoms";Single-component entry points tree-shake to just this component: @jcsoftdev/ui/atoms/avatar.
<Avatar name="Diego Quispe" size="md" />| Prop | Type | Default | Description |
|---|---|---|---|
name * |
string |
Full name: used for the initials fallback and as the accessible name. | |
src |
string |
||
size |
"md" | "lg" |
"md" |
|
highlighted |
boolean |
Fills the avatar with the accent color (e.g. the current user). Wins over tone. |
|
tone |
AvatarTone |
"neutral" |
Soft background and ink colour of the initials. |
status |
StatusDotTone |
Small status dot at the bottom-right corner. | |
decorative |
boolean |
Hides the avatar from assistive technology, for one beside a visible name that already says who it is. aria-hidden passed directly does the same. |
|
statusLabel |
string |
Accessible text for the status dot; defaults to the status name. | |
classNames |
Partial<Record<AvatarPart, string>> |
Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last. |
* marks a required prop.
It also accepts the native props of the element or primitive it renders (for example className, id, aria-* and event handlers).
Storybook stories
Section titled “Storybook stories”Source
Section titled “Source”packages/ui/src/atoms/avatar/avatar.tsx