Avatar

Radix avatar with a sketch circular or square frame. Falls back to initials, with an optional status dot.

<Avatar fallback="AL" shape="circle" status="online" roughness={1.5} />

CLI install

npx doodleui-react add avatar

Usage

import { Avatar } from "doodleui-react";

<Avatar fallback="AL" alt="Ada Lovelace" status="online" />

Image loading and the fallback swap come from Radix. doodle-ui draws the frame and the status badge.

Props

PropTypeDefaultNotes
srcstringundefinedImage URL. Falls back to initials if missing or loading.
fallbackReactNodeundefinedInitials or placeholder shown without an image.
sizenumber40Width and height in pixels.
shape"circle" | "square""circle"Frame geometry.
status"online" | "offline" | "busy"undefinedOptional sketch status dot.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.