Avatar
pure-ui/avatarFreeComponent
An easily stylable avatar component.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/MusKRI/pure-ui/main/public/r/avatar.jsonSource
1"use client";23import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";45import { cn } from "@/lib/classes";67export interface AvatarProps extends AvatarPrimitive.Root.Props {}89function Avatar({ className, ...props }: AvatarProps) {10 return (11 <AvatarPrimitive.Root12 className={cn(13 "inline-flex size-10 shrink-0 select-none items-center justify-center overflow-hidden rounded-full bg-muted align-middle font-medium text-xs",14 className15 )}16 data-slot="avatar"17 {...props}18 />19 );20}2122export interface AvatarImageProps extends AvatarPrimitive.Image.Props {}2324function AvatarImage({ className, ...props }: AvatarImageProps) {25 return (26 <AvatarPrimitive.Image27 className={cn("size-full object-cover", className)}28 data-slot="avatar-image"29 {...props}30 />31 );32}3334export interface AvatarFallbackProps extends AvatarPrimitive.Fallback.Props {}3536function AvatarFallback({ className, ...props }: AvatarFallbackProps) {37 return (38 <AvatarPrimitive.Fallback39 className={cn(40 "flex size-full items-center justify-center rounded-full bg-muted",41 className42 )}43 data-slot="avatar-fallback"44 {...props}45 />46 );47}4849export { Avatar, AvatarImage, AvatarFallback };
What it pulls in
npm packages
Other registry items
Files it writes
More from Pure UI
All 291 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Pure UI | Components | Free | 4 deps | |
| Badgebadge | Pure UI | Components | Free | 4 deps | |
| Buttonbutton | Pure UI | Components | Free | 4 deps | |
| Button Groupbutton-group | Pure UI | Components | Free | 4 deps | |
| Calendarcalendar | Pure UI | Components | Free | 4 deps | |
| Cardcard | Pure UI | Components | Free | 2 deps | |
| Checkboxcheckbox | Pure UI | Components | Free | 4 deps | |
| Collapsiblecollapsible | Pure UI | Components | Free | 3 deps |
