avatar
yyc3-knowledge-base/avatarUnverifiedComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/YYC-Cube/YYC3-Knowledge-Base/main/YYC3-D/ui/apps/v4/avatar.jsonSource
1"use client"23import * as React from "react"4import * as AvatarPrimitive from "@radix-ui/react-avatar"56import { cn } from "@/lib/utils"78const Avatar = React.forwardRef<9 React.ElementRef<typeof AvatarPrimitive.Root>,10 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>11>(({ className, ...props }, ref) => (12 <AvatarPrimitive.Root13 ref={ref}14 className={cn(15 "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",16 className17 )}18 {...props}19 />20))21Avatar.displayName = AvatarPrimitive.Root.displayName2223const AvatarImage = React.forwardRef<24 React.ElementRef<typeof AvatarPrimitive.Image>,25 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>26>(({ className, ...props }, ref) => (27 <AvatarPrimitive.Image28 ref={ref}29 className={cn("aspect-square h-full w-full", className)}30 {...props}31 />32))33AvatarImage.displayName = AvatarPrimitive.Image.displayName3435const AvatarFallback = React.forwardRef<36 React.ElementRef<typeof AvatarPrimitive.Fallback>,37 React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>38>(({ className, ...props }, ref) => (39 <AvatarPrimitive.Fallback40 ref={ref}41 className={cn(42 "flex h-full w-full items-center justify-center rounded-full bg-muted",43 className44 )}45 {...props}46 />47))48AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName4950export { Avatar, AvatarImage, AvatarFallback }
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 411 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Unverified | 1 dep | |
| alertalert | shadcn/ui | Components | Unverified | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Unverified | 1 dep | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Unverified | 1 dep | |
| badgebadge | shadcn/ui | Components | Unverified | 1 dep | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Unverified | 1 dep | |
| buttonbutton | shadcn/ui | Components | Unverified | 1 dep | |
| button-groupbutton-group | shadcn/ui | Components | Unverified | no deps |
