avatar
shipbase-ui/avatarFreeComponent
shipbase/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/shipbase/ui/next/apps/www/public/r/react/avatar.jsonSource
1"use client"23import * as React from "react"45import { Avatar as AvatarPrimitive } from "@ark-ui/react/avatar"67import { cn } from "@/lib/utils"89const Avatar = React.forwardRef<10 React.ElementRef<typeof AvatarPrimitive.Root>,11 AvatarPrimitive.RootProps12>(({ className, ...props }, ref) => (13 <AvatarPrimitive.Root14 ref={ref}15 className={cn(16 "relative flex size-8 shrink-0 overflow-hidden rounded-full",17 className18 )}19 {...props}20 />21))22Avatar.displayName = "Avatar"2324const AvatarContext = AvatarPrimitive.Context2526const AvatarFallback = React.forwardRef<27 React.ElementRef<typeof AvatarPrimitive.Fallback>,28 AvatarPrimitive.FallbackProps29>(({ className, ...props }, ref) => (30 <AvatarPrimitive.Fallback31 ref={ref}32 className={cn(33 "flex size-full items-center justify-center rounded-[inherit] bg-secondary text-xs",34 className35 )}36 {...props}37 />38))39AvatarFallback.displayName = "AvatarFallback"4041const AvatarImage = React.forwardRef<42 React.ElementRef<typeof AvatarPrimitive.Image>,43 AvatarPrimitive.ImageProps44>(({ className, ...props }, ref) => (45 <AvatarPrimitive.Image46 ref={ref}47 className={cn("aspect-square size-full", className)}48 {...props}49 />50))51AvatarImage.displayName = "AvatarImage"5253export { Avatar, AvatarContext, AvatarFallback, AvatarImage }
What it pulls in
npm packages
Files it writes
More from shipbase/ui
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shipbase/ui | Components | Free | 2 deps | |
| badgebadge | shipbase/ui | Components | Free | 2 deps | |
| buttonbutton | shipbase/ui | Components | Free | 2 deps | |
| cardcard | shipbase/ui | Components | Free | 1 dep | |
| checkboxcheckbox | shipbase/ui | Components | Free | 2 deps | |
| collapsiblecollapsible | shipbase/ui | Components | Free | 1 dep | |
| comboboxcombobox | shipbase/ui | Components | Free | 2 deps | |
| dialogdialog | shipbase/ui | Components | Free | 2 deps |
