v0.0.2
Demos (demo panel, opens in a new tab)

Avatar

Shows a person or a record as a small round image; without a photo, initials are made from the name.

zb:avatar zubazar/ui · free (MIT)

Size and color

Size and color: view
BLADE

size picks the size (xs or sm in dense lists, lg or xl in profile headers) and color the background of the initials.

size
color
blade
<zb:avatar name="Ayşe Yılmaz" size="md" color="primary" />
blade
<zb:avatar name="Ayşe Yılmaz" size="md" color="success" />
blade
<zb:avatar name="Ayşe Yılmaz" size="md" color="warning" />
blade
<zb:avatar name="Ayşe Yılmaz" size="md" color="danger" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xs" color="primary" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xs" color="success" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xs" color="warning" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xs" color="danger" />
blade
<zb:avatar name="Ayşe Yılmaz" size="sm" color="primary" />
blade
<zb:avatar name="Ayşe Yılmaz" size="sm" color="success" />
blade
<zb:avatar name="Ayşe Yılmaz" size="sm" color="warning" />
blade
<zb:avatar name="Ayşe Yılmaz" size="sm" color="danger" />
blade
<zb:avatar name="Ayşe Yılmaz" size="lg" color="primary" />
blade
<zb:avatar name="Ayşe Yılmaz" size="lg" color="success" />
blade
<zb:avatar name="Ayşe Yılmaz" size="lg" color="warning" />
blade
<zb:avatar name="Ayşe Yılmaz" size="lg" color="danger" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xl" color="primary" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xl" color="success" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xl" color="warning" />
blade
<zb:avatar name="Ayşe Yılmaz" size="xl" color="danger" />
PropValues
sizexs | sm | md | lg | xl
colorprimary | secondary | success | danger | warning | info | dark

Initials and colors

Initials and colors: view
BLADE

Without a photo, the initials of the first two words of name are shown ("Ayşe Yılmaz" → AY); color picks the background color.

blade
<div class="flex flex-wrap items-center gap-4">
    <zb:avatar name="Ayşe Yılmaz" />
    <zb:avatar name="Mehmet Kaya" color="success" />
    <zb:avatar name="Zeynep Arslan" color="warning" />
    <zb:avatar name="Emre Demir" color="danger" />
    <zb:avatar name="Fatma Şahin" color="info" />
    <zb:avatar name="Can Öztürk" color="secondary" />
</div>
PropValues
nameFull name; the initials are generated from it
colorprimary | secondary | success | danger | warning | info | dark (brand = primary, neutral = secondary)

Photo

BLADE

src shows the photo; still give name, as it becomes the alternative text and nothing is left blank if the photo fails to load.

blade
<zb:avatar src="{{ $user->avatar_url }}" :name="$user->name" size="lg" />
PropValues
srcPhoto address

Status

Status: view
BLADE

status adds a status dot at the bottom right: online, offline, away or busy.

blade
<div class="flex flex-wrap items-center gap-4">
    <zb:avatar name="Ayşe Yılmaz" status="online" />
    <zb:avatar name="Mehmet Kaya" color="success" status="offline" />
    <zb:avatar name="Zeynep Arslan" color="warning" status="away" />
    <zb:avatar name="Emre Demir" color="danger" status="busy" />
</div>
PropValues
statusonline | offline | away | busy

Groups

Groups: view
BLADE

zb:avatar-group overlaps the avatars; add the number of people not shown as "+N" with more.

blade
<zb:avatar-group :more="4">
    <zb:avatar name="Ayşe Yılmaz" />
    <zb:avatar name="Mehmet Kaya" color="success" />
    <zb:avatar name="Zeynep Arslan" color="warning" />
    <zb:avatar name="Emre Demir" color="info" />
</zb:avatar-group>
PropValues
moreNumber of people not shown ("+N"); hidden when 0

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
src, name—nullWithout a photo, initials from the name
size—mdxs · sm · md · lg · xl
shape—circlecircle · rounded-sm
status—nullonline · offline · away · busy
color—primaryprimary · secondary · success · danger · warning · info · dark (brand = primary, neutral = secondary)
avatar-group: morenumber0"+N" indicator
avatar-group: size—mdSize of the "+N" indicator; give the same as the avatars (xs · sm · md · lg · xl)

Advanced

1 example

Shapes

Shapes: view
BLADE

The default shape is a circle. For records that are not people, such as organizations, teams or products, use a square with rounded corners via shape="rounded-sm".

blade
<div class="flex flex-wrap items-center gap-4">
    <zb:avatar name="Ayşe Yılmaz" size="lg" />
    <zb:avatar name="Zubazar Soft" size="lg" shape="rounded-sm" />
</div>
PropValues
shapecircle | rounded-sm
Zubazar UI · ZubazarDesigned for people.