Avatar (Tailwind)
roi-ui/avatar-tailwindFreeItem
An image element with a fallback for representing the user.
Install it
npx shadcn@latest add https://roiui.com/r/avatar-tailwind.jsonSource
1"use client";23import { Avatar } from "@base-ui/react/avatar";4import { cn } from "@/lib/utils";56function AvatarRoot({ className, ...props }: Avatar.Root.Props) {7 return (8 <Avatar.Root9 className={cn(10 "relative inline-flex h-10 w-10 select-none items-center justify-center overflow-hidden rounded-full bg-muted align-middle",11 className12 )}13 data-slot="avatar-root"14 {...props}15 />16 );17}1819function AvatarImage({ className, ...props }: Avatar.Image.Props) {20 return (21 <Avatar.Image22 className={cn("h-full w-full rounded-[inherit] object-cover", className)}23 data-slot="avatar-image"24 {...props}25 />26 );27}2829function AvatarFallback({ className, ...props }: Avatar.Fallback.Props) {30 return (31 <Avatar.Fallback32 className={cn(33 "flex h-full w-full items-center justify-center rounded-[inherit] bg-muted font-medium text-muted-foreground text-sm uppercase",34 className35 )}36 data-slot="avatar-fallback"37 {...props}38 />39 );40}4142export { AvatarRoot as Avatar, AvatarFallback, AvatarImage };
Files it writes
More from Roi UI
All 123 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | Roi UI | Other | Free | no deps · 2 files | |
| Accordion (Tailwind)accordion-tailwind | Roi UI | Other | Free | no deps | |
| AI Chatai-chat | Roi UI | Other | Free | no deps · 2 files | |
| AI Chat (Tailwind)ai-chat-tailwind | Roi UI | Other | Free | no deps | |
| Alertalert | Roi UI | Other | Free | 1 dep · 2 files | |
| Alert Dialogalert-dialog | Roi UI | Other | Free | no deps · 2 files | |
| Alert Dialog (Tailwind)alert-dialog-tailwind | Roi UI | Other | Free | no deps | |
| Alert (Tailwind)alert-tailwind | Roi UI | Other | Free | 1 dep |
