Avatar
11.0.18
The Avatar component assists users in understanding content, without being the focal point in a UI. They can represent a user or a brand.
| Namn | Typ | Beskrivning |
|---|---|---|
customAttribute | { attribute: string; value: string | number; } | Used for tests. Clickable and requested subcomponents will be suffixed with "-[ComponentName]". |
icon | React.FC<React.SVGProps<SVGSVGElement>> | Icon to display in the avatar. We recommend using an icon from @sj-ab/component-library.ui.icons |
id | string | Unique identifier for the component. |
initials | string | Initials to display in the avatar. Must be exactly two characters, representing the first and last name, without any spaces (e.g., "MM"). |
isLoading | boolean | If true, a loading skeleton will be rendered instead of the component. |
passengerCategory | "ADULT" | "CHILD_AND_YOUTH" | "STUDENT" | "SENIOR" | Specifies the background color of the avatar based on the category of the passenger. |
size | "xs" | "sm" | "md" | "lg" | "xl" | Size of the avatar. |
alt | string | never | Used in combination with src to provide an alt attribute for the rendered img element. |
src | string | undefined | The src attribute for the img element. |
srcSet | string | never | The srcSet attribute for the img element. Use this attribute for responsive image display. |
npm install @sj-ab/component-library.ui.avatarAvatar ska enbart användas som komplement till annat innehåll. Bilden och textinitialerna är därför dolda för skärmläsare med aria-hidden.
Importer av Avatar
Repos med Avatar
Senaste installerade version av Avatar
Äldsta installerade version av Avatar