Avatar

A compact identity marker for people and accounts.

npx shadcn@latest add @silicon-ui/avatar
identitypeople
Loading…

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. Shared files are skipped if you already have them.

    • components/silicon-ui/avatar/avatar.tsx
    • components/silicon-ui/avatar/avatar.module.css
    • components/silicon-ui/lib/silicon-provider.tsx shared
  3. Install the foundation once per app for the design and motion tokens: npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

Source codetsx
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