Controls

Avatar

Preview
Reduced motion

Simulates prefers-reduced-motion for the demo. Off follows your system setting.

Keyboard stepping

Steps focus through the demo with ] and [. Tab, arrows, and Escape stay native so the component behaves as shipped.

Avatar
+2

Avatar

A squircle portrait with initials as a fallback and an optional status dot.

Installation

npx shadcn@latest add ikislay/pixel-ui/avatar

How to use

import { Avatar } from "@/components/ui/avatar"
export function Demo() {
return <Avatar name="Mira Okafor" src="/mira.jpg" status="online" />
}

Source Code

// Loading…

Props

Options you can pass to customize this component.

Prop
Type
Description
name*
string

The person's name. It gives the initials and the accessible label.

src
string

The photo URL.

size
smmdlg

32, 44 or 64 pixels square.

status
onlineawayoffline

Shows a status dot and adds it to the label.

className
string

Merged onto the root element.