Skip to content

Avatar

A compact identity marker for people and accounts.

IdentityPeople
npx shadcn@latest add @silicon-ui/avatar

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/avatar

Manually

  1. Install the dependencies

    npm install motion
  2. Copy these files into your project

    • components/silicon-ui/avatar/avatar.tsx
    • components/silicon-ui/avatar/avatar.module.css

    Shared with other components. Skip any you already have.

    • components/silicon-ui/lib/silicon-provider.tsx
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { Avatar } from "@/components/silicon-ui/avatar/avatar";

API reference

PropTypeDefault
name*string—
srcstring—
size"xs" | "sm" | "md" | "lg" | "xl""md"
status"online" | "offline"—

Also accepts the props of HTMLAttributes<HTMLSpanElement>.

Dependencies

npm
motion
Registry
silicon-motion-tokens