Avatar
thegridcn/avatarFreeComponent
thegridcn publishes no description for this item.
Install it
npx shadcn@latest add https://thegridcn.com/r/avatar.jsonSource
1"use client"23import * as React from "react"4import * as AvatarPrimitive from "@radix-ui/react-avatar"56import { cn } from "@/lib/utils"78function Avatar({9 className,10 ...props11}: React.ComponentProps<typeof AvatarPrimitive.Root>) {12 return (13 <AvatarPrimitive.Root14 data-slot="avatar"15 className={cn(16 "relative flex size-8 shrink-0 overflow-hidden rounded-sm",17 className18 )}19 {...props}20 />21 )22}2324function AvatarImage({25 className,26 ...props27}: React.ComponentProps<typeof AvatarPrimitive.Image>) {28 return (29 <AvatarPrimitive.Image30 data-slot="avatar-image"31 className={cn("aspect-square size-full", className)}32 {...props}33 />34 )35}3637function AvatarFallback({38 className,39 ...props40}: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {41 return (42 <AvatarPrimitive.Fallback43 data-slot="avatar-fallback"44 className={cn(45 "bg-muted flex size-full items-center justify-center rounded-sm",46 className47 )}48 {...props}49 />50 )51}5253export { Avatar, AvatarImage, AvatarFallback }
What it pulls in
npm packages
Files it writes
More from thegridcn
All 139 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | thegridcn | Components | Free | 2 deps | |
| Agent Avataragent-avatar | thegridcn | Components | Free | no deps | |
| Alertalert | thegridcn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | thegridcn | Components | Free | 1 dep | |
| Announcement Barannouncement-bar | thegridcn | Components | Free | no deps | |
| Anomaly Banneranomaly-banner | thegridcn | Components | Free | no deps | |
| Arrival Panelarrival-panel | thegridcn | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | thegridcn | Components | Free | 1 dep |
