Sizes
import { html, renderApp } from 'mates';
import { Avatar } from 'mates-ui';
const App = () => () => html`
<x-row gap="var(--md-space-4)" align="center">
${Avatar({ name: "Alice Wang", size: "xs" })}
${Avatar({ name: "Bob Smith", size: "sm" })}
${Avatar({ name: "Carol Jones", size: "md" })}
${Avatar({ name: "David Brown", size: "lg" })}
${Avatar({ name: "Eve Johnson", size: "xl" })}
</x-row>
`;
renderApp(App, document.getElementById('app'));
Image
import { html, renderApp } from 'mates';
import { Avatar } from 'mates-ui';
const App = () => () => html`
<x-row gap="var(--md-space-3)" align="center">
${Avatar({ src: "https://i.pravatar.cc/80?img=1", name: "User 1", size: "md" })}
${Avatar({ src: "https://i.pravatar.cc/80?img=5", name: "User 2", size: "md" })}
${Avatar({ src: "https://i.pravatar.cc/80?img=12", name: "User 3", size: "md" })}
${Avatar({ src: "https://i.pravatar.cc/80?img=47", name: "User 4", size: "lg" })}
</x-row>
`;
renderApp(App, document.getElementById('app'));
Status dot
import { html, renderApp } from 'mates';
import { Avatar } from 'mates-ui';
const App = () => () => html`
<x-row gap="var(--md-space-4)" align="center">
${Avatar({ name: "Alice", status: "online", size: "md" })}
${Avatar({ name: "Bob", status: "away", size: "md" })}
${Avatar({ name: "Carol", status: "busy", size: "md" })}
${Avatar({ name: "David", status: "offline", size: "md" })}
${Avatar({ src: "https://i.pravatar.cc/80?img=3", name: "Eve", status: "online", size: "lg" })}
</x-row>
`;
renderApp(App, document.getElementById('app'));
Initials override
import { html, renderApp } from 'mates';
import { Avatar } from 'mates-ui';
const App = () => () => html`
<x-row gap="var(--md-space-3)" align="center">
${Avatar({ name: "Ada Lovelace", size: "lg" })}
${Avatar({ name: "Grace Hopper", size: "lg" })}
${Avatar({ name: "Alan Turing", size: "lg" })}
${Avatar({ initials: "AB", size: "lg" })}
${Avatar({ initials: "XY", size: "lg" })}
${Avatar({ initials: "42", size: "lg" })}
</x-row>
`;
renderApp(App, document.getElementById('app'));
Icon fallback
import { html, renderApp } from 'mates';
import { Avatar } from 'mates-ui';
import { AccountCircleIcon, GroupIcon, PersonIcon, SmartToyIcon, SupportAgentIcon } from 'mates-icons';
const App = () => () => html`
<x-row gap="var(--md-space-3)" align="center">
${Avatar({ icon: PersonIcon(), size: "md" })}
${Avatar({ icon: SmartToyIcon(), size: "md" })}
${Avatar({ icon: SupportAgentIcon(), size: "lg" })}
${Avatar({ icon: GroupIcon(), size: "lg" })}
${Avatar({ icon: AccountCircleIcon(), size: "xl" })}
</x-row>
`;
renderApp(App, document.getElementById('app'));