GitHub
Docs
Avatar

Avatar

An image element with a fallback for representing the user.

Loading...
Loading...

Installation

pnpm dlx shadcn-ng@latest add avatar
npx shadcn-ng@latest add avatar
npx shadcn-ng@latest add avatar
bunx --bun shadcn-ng@latest add avatar

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

import {
    UbAvatarDirective,
    UbAvatarImageDirective,
    UbAvatarFallbackDirective
} from '~/components/ui/avatar.directive'
<span ubAvatar>
    <img src="https://github.com/adrian-ub.png" alt="@adrianub" ubAvatarImage />
    <span ubAvatarFallback>UB</span>
</span>