Skip to content

zk-avatar ​

A user picture, with the initials of the name or the slot as a fallback.

Props ​

PropTypeDefaultDescription
srcstring|nullnullURL of the picture
namestring|nullnullName: gives the initials (two letters) and the accessible name
altstring|nullnullAccessible name, over the name
sizestring'medium'small, medium or large: data-size
shapestring'circle'circle or square: data-shape
classstring|nullnullCSS class(es) merged onto the root element

Undeclared attributes forward to the root element.

Slots ​

SlotDescription
defaultContent shown when there is no picture and no name

The root has role="img" and an aria-label; the picture itself is decorative (alt="").

Examples ​

Picture ​

blade
<x-zk-avatar src="/ada.png" name="Ada Lovelace" />

Initials ​

blade
<x-zk-avatar name="Ada Lovelace" />

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.