Data Display · ui · 6K

Avatar

Radix Avatar as a square 1-bit portrait frame (24, 32 or 40px) with shadcn/ui's API, badge and group. The fallback shows initials in the chrome face on a sparse dither; dither renders the photo as an Atkinson dither, dither="filter" with a CSS grayscale filter.

dither stretches the photo to the square, so crop portraits square. Cross-origin images need CORS headers and crossOrigin="anonymous" for the canvas dither (see Dither image).

Install

pnpm dlx shadcn@latest add @s7ui/avatar

Example

KL
Fallback
AB
Image
AB
dither="filter"
AB
dither
SMDLG
ABCDEFGH
+4

Info

Files:
components/ui/avatar.tsx
Uses:
@s7ui/theme, @s7ui/dither-image
Packages:
radix-ui