Free
Pro

Avatar

An avatar specifically refers to a character that represents an online user. Base theme present avatar in two shapes.

free

Default Avatar

Default Avatar examples below.


HTML

Avatar Shape

By default avatar component is with square shape with rounded borders. To make it circular use attribute shape="circle".


HTML

Avatar Status

Use attribute status="..." to define user status. Base theme supports two statuses, "active" and "inactive".


HTML

Avatar Sizes

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.


HTML

Installation

Run the following command to add this component to your project:

bash

npx base-ui-cli add avatar

API Reference

For AI agents

Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.

bash

npx -y base-ui-mcp

Base UI provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

// 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 reference for avatar
APIMemberTypeDefaultDescription
base-avatarclassstring''Additional host CSS classes (merged via cn()).
base-avataravatarUrlstring | undefined''
base-avatarshapeAvatarShape'square'
base-avatarstatusAvatarStatus | undefinedundefined
base-avatarsizeAvatarSize'md'
base-avatarinitialsstring''