Aurora Avatar
aurora-dinglebear-ai/aurora-avatarUnverifiedComponent
Circular avatar with gradient fallback initials and Aurora border styling.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/dinglebear-ai/aurora/main/aurora-avatar.jsonSource
1"use client"23import * as React from "react"4import * as AvatarPrimitive from "@radix-ui/react-avatar"5import { cn } from "@/lib/utils"67// ─── Size map ─────────────────────────────────────────────────────────────────89const sizeMap = {10 sm: { wh: 24, text: 9, statusSize: 7, statusOffset: -1 },11 md: { wh: 32, text: 11, statusSize: 9, statusOffset: -1 },12 lg: { wh: 40, text: 13, statusSize: 10, statusOffset: 0 },13 xl: { wh: 56, text: 17, statusSize: 13, statusOffset: 1 },14} as const1516type AvatarSize = keyof typeof sizeMap17type AvatarVariant = "default" | "beacon" | "bot" | "status"18type AvatarShape = "circle" | "square"19type StatusColor = "online" | "away" | "busy" | "offline"2021const statusColorMap: Record<StatusColor, string> = {22 online: "var(--aurora-success)",23 away: "var(--aurora-warn)",24 busy: "var(--aurora-error)",25 offline: "var(--aurora-status-offline)",26}2728// Styles: registry/aurora/styles/aurora-components.css (@layer aurora-components).2930// ─── Avatar component ─────────────────────────────────────────────────────────3132export interface AvatarProps33 extends Omit<34 React.ComponentProps<typeof AvatarPrimitive.Root>,35 "color"36 > {37 /** Visual variant */38 variant?: AvatarVariant39 /** Size preset or explicit pixel size */40 size?: AvatarSize | number41 /** Image src */42 src?: string43 /** Alt text */44 alt?: string45 /** Fallback text (initials) — alias for `initials` */46 fallback?: string47 /**48 * Initials rendered as the fallback. Drives the tone-tinted surface, ring,49 * and text color. Takes precedence over `fallback`.50 */51 initials?: string52 /**53 * Tone — any CSS color (typically an Aurora accent token such as54 * `var(--aurora-accent-primary)`). Colors the initials, the tinted surface55 * and the soft tone ring.56 */57 tone?: string58 /** Trusted React icon rendered instead of initials. */59 icon?: React.ReactNode60 /** Circle (default) or rounded square. */61 shape?: AvatarShape62 /** Adds an outer focus-style ring in the avatar's tone. */63 ring?: boolean64 /** Status dot color — shown when `status` is set or variant="status". */65 status?: StatusColor66}6768const DEFAULT_TONE = "var(--aurora-accent-primary)"6970function Avatar({71 ref,72 className,73// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from aurora
All 176 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Aurora Accordionaurora-accordion | aurora | Components | Unverified | 2 deps | |
| Aurora Alert Dialogaurora-alert-dialog | aurora | Components | Unverified | 2 deps | |
| Aurora Aspect Ratioaurora-aspect-ratio | aurora | Components | Unverified | no deps | |
| Aurora Badgeaurora-badge | aurora | Components | Unverified | 2 deps | |
| Aurora Banneraurora-banner | aurora | Components | Unverified | 1 dep | |
| Aurora Breadcrumbaurora-breadcrumb | aurora | Components | Unverified | 2 deps | |
| Aurora Buttonaurora-button | aurora | Components | Unverified | 2 deps | |
| Aurora Button Groupaurora-button-group | aurora | Components | Unverified | no deps |
