Componentdata0.52 KB gzipZero dependencies
Avatar
Initials or photo badge with dashed ring.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add avatarOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { Avatar } from "@/components/ui/avatar"; <Avatar name="Ada Bull" />Source code
avatar.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| name | string | Full name, used for initials and aria-label (required). |
| src | string | Photo URL, falls back to initials on error. |
| size | Size | Avatar size (default md). |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |