Avatar
blok/avatarFreeComponent
An image element with a fallback for representing the user.
Install it
npx shadcn@latest add https://blok.sitecore.com/r/avatar.jsonSource
1"use client";23import { Avatar as AvatarPrimitive } from "radix-ui";4import type * as React from "react";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-full",17 className,18 )}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-full",46 className,47 )}48 {...props}49 />50 );51}5253export { Avatar, AvatarImage, AvatarFallback };
What it pulls in
npm packages
Other registry items
Files it writes
More from blok
All 72 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | blok | Components | Free | 2 deps · 2 files | |
| Action baraction-bar | blok | Components | Free | 1 dep · 2 files | |
| Alertalert | blok | Components | Free | 2 deps · 2 files | |
| Alert dialogalert-dialog | blok | Components | Free | 2 deps | |
| Aspect ratioaspect-ratio | blok | Components | Free | 1 dep | |
| Badgebadge | blok | Components | Free | 2 deps | |
| All componentsblok-components | blok | Components | Free | no deps | |
| Breadcrumbbreadcrumb | blok | Components | Free | 2 deps · 2 files |
