Skip to main content

Avatar

shadow

Element avatar slúži na vizuálnu prezentáciu používateľa alebo subjektu. Používa sa zvyčajne ako obaľovač a poskytuje praktický spôsob zobrazovania profilových obrázkov, ikon, alebo, ak tie nie sú poskytnuté, iniciálok. Podporuje rôzne konfigurácie vrátane veľkosti, zoskupenia viacerých avatarov alebo zobrazenie dropdownu po kliknutí či tooltipu pri ukázaní myšou.

Základné použitie

Veľkosť Avatara

Vlastnosť size určuje veľkosť avatara.

Veľkosť Avatara s iniciálmi

Vlastnosť size určuje veľkosť avatara. Pridaním vlastností initials a label avatar zobrazí iniciály zvolenej hodnoty vlastnosti label.

Avatar s ikonou

Vnorením elementu wje-icon sa vo vnútri avatara zobrazí zvolená ikona.

Avatar s iniciálmi

Pridaním vlastností initials a label avatar zobrazí iniciály zvolenej hodnoty vlastnosti label.

Avatar so statusom

Vnorením elementu wje-status s ikonou, sa po stranách Avatara zobrazí element Status. Pridaním atribútu status-placement je možné určiť pozíciu elementu Status.

Pre viac informácií o použítí Status sa presuňte do dokumentácie elementu Status. // TODO: link

Avatar s dropdownom

Pridaním elementu wje-dropdown sa po kliknutí na avatar zobrazí menu. V tomto prípade je nutné do elementu avatar pridať slot trigger s hodnotou hover.

Avatar s tooltipom

Pridaním elementu wje-dropdown sa po kliknutí na avatar zobrazí menu.

Skupina avatarov

Atribúty a Vlastnosti

initials

DescriptionIf true, the avatar displays the initials of the label attribute value
Attributeinitials
Typeboolean
Defaultfalse

label

DescriptionSpecifies the value for the initials attribute
Attributelabel
Typestring
Defaultundefined

size

DescriptionSelect one of the supported values to set the avatar size. By default, the size is unset.
Attributesize
Type"medium" | "normal" | "large" | "small" | "x-large" | "2x-large" | "3x-large" | "4x-large" | "5x-large" | "undefined"
Defaultfalse

status-placement

DescriptionSet to one of the supported values to place the status on the corners of the avatar. By default, the size is unset.
Attributestatus-placement
Type"top-start" | "top-end"" | "bottom-start" | "bottom-end" | "undefined"
Defaultfalse

Eventy

No events available for this component.

Metódy

No public methods available for this component.

CSS Shadow Parts

NameDescription
nativeRefers to the div element inside the avatar

CSS Custom Vlastnosti

NameDescription
--wj-avatar-background-colorAvatar background colour
--wj-avatar-border-colorAvatar border colour
--wj-avatar-border-radiusRounding of the edge of the avatar
--wj-avatar-border-styleAvatar border style
--wj-avatar-border-widthEdge width
--wj-avatar-colorText colour
--wj-avatar-font-sizeFont size
--wj-avatar-font-weightFont thickness
--wj-avatar-heightHeight of avatar
--wj-avatar-widthWidth of avatar

Sloty

NameDescription
``The main content of the avatar.
iconSlot for the icon to be displayed within the avatar.
statusSlot for status indicator.
secondarySlot for secondary content or additional information.