Componentdata0.52 KB gzipZero dependencies

Avatar

Initials or photo badge with dashed ring.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add avatar

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { Avatar } from "@/components/ui/avatar"; <Avatar name="Ada Bull" />

Source code

avatar.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxavatar.tsx62 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; type Size = "sm" | "md" | "lg"; export type AvatarProps = {  name?: string;  src?: string;  size?: Size;  className?: string;}; const sizes: Record<Size, string> = {  sm: "size-8 text-xs",  md: "size-10 text-sm",  lg: "size-12 text-base",

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { Avatar } from "@/components/ui/avatar"; <Avatar />
PropTypeDescription
namestringFull name, used for initials and aria-label (required).
srcstringPhoto URL, falls back to initials on error.
sizeSizeAvatar size (default md).
classNamestringOptional Tailwind or custom CSS classes merged with component styles.