An avatar specifically refers to a character that represents an online user. Base theme present avatar in two shapes.
Default Avatar examples below.
By default avatar component is with square shape with rounded borders. To make it circular use attribute shape="circle".
Use attribute status="..." to define user status. Base theme supports two statuses, "active" and "inactive".
Base theme Avatar supports 5 sizes. Use size="" with supported "xs", "sm", "md", "lg" or "xl" to define avatar size. Or you can define the size manually by using tailwind class for width and height.
Run the following command to add this component to your project:
npx base-ui-cli add avatar
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add avatar
// Paths are relative to aliases.components (default: src/app/components)
import { AvatarComponent } from './avatar/avatar.component';
@Component({
selector: 'app-your-component',
imports: [
AvatarComponent
],
template: `...`
})
export class YourComponent {} API for avatar — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
base-avatar | class | string | '' | Additional host CSS classes (merged via cn()). |
base-avatar | avatarUrl | string | undefined | '' | — |
base-avatar | shape | AvatarShape | 'square' | — |
base-avatar | status | AvatarStatus | undefined | undefined | — |
base-avatar | size | AvatarSize | 'md' | — |
base-avatar | initials | string | '' | — |
Page Content