Component
Vue Avatar Component
<DomAvatar>A compact identity primitive for people, teams, workspaces, and accounts.
Playground
Try every prop live
Avatar playground
Adjust the props to explore sizing, content, and behaviour.
Properties
Control props
Image URL.
Image alt text. Leave empty when adjacent text already names the person or object.
Name used to generate fallback initials.
Explicit fallback initials.
Avatar size.
Avatar shape.
Playground.vuevue
Install
npm install @getdom/studiovue
<script setup>
import '@getdom/studio/style.css';
import { reactive } from 'vue';
import { DomAvatar } from '@getdom/studio';
const data = reactive({
"src": "https://images.unsplash.com/photo-1494790108377-be9c29b29330?auto=format&fit=crop&crop=faces&w=96&h=96&q=80",
"alt": "",
"name": "Mina Patel",
"initials": "MP",
"size": "md",
"shape": "circle"
});
</script>
<template>
<DomAvatar
v-bind="data"
/>
</template>Reference
Props
Control props
| Name | Type | TS | Default | Description |
|---|---|---|---|---|
src | string | string | '' | Image URL. |
alt | string | string | '' | Image alt text. Leave empty when adjacent text already names the person or object. |
name | string | string | '' | Name used to generate fallback initials. |
initials | string | string | '' | Explicit fallback initials. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | string | 'md' | Avatar size. |
shape | 'circle' | 'rounded' | 'square' | string | 'circle' | Avatar shape. |
Auto-generated from Avatar.props and inline _edit hints.
Slots
| Name | Scope | Description |
|---|---|---|
| #fallback | — | Custom fallback content when no image is available. |