Skip to content
Ballpoint

Avatar

A portrait circled with the pen; initials on a wash of ink when there's no picture.

From shadcn/ui
Built on Base UI Avatar
DPALGH
ALGHKJ
+4

Installation

pnpm dlx shadcn@latest add @ballpoint/avatar

Usage

tsx
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"

<Avatar>
  <AvatarImage src="/me.jpg" alt="Me" />
  <AvatarFallback>ON</AvatarFallback>
</Avatar>

Examples

User list

Avatars with a name, an email and an online dot.

  • AL
    Ada Lovelaceada@example.com
  • GH
    Grace Hoppergrace@example.com
  • KJ
    Katherine Johnsonkatherine@example.com

Sizes

Four sizes, from a margin dot to a profile picture.

GH
sm
GH
default
GH
lg
GH
xl

Stacked

A group that overlaps like coins, with how many more.

ALGHKJ
+2
Ada, Grace, Katherine and 2 others are writing.
ALGHKJMJDV

Profile

A large avatar with a status dot, a role and a follow button.

GH
Grace HopperEditor
Writing since 1952. Online now.

API reference

size
default "default"
"sm" | "default" | "lg" | "xl"

24, 32, 40 or 56px; the initials and the status dot scale with it.

seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Avatar.

Pen settings

The drawing also takes draw, passes, weight and speed, as props or from the nearest InkProvider. What each one does.