BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/basecn/avatar

Avatar

basecn/avatar
FreeComponent

An easily stylable avatar component.

Live preview

live · rendered by the registry
Rendered by basecn on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://basecn.dev/r/avatar.json

Source

src/registry/components/ui/avatar.tsxbasecn.dev/r/avatar.json
1import { cn } from "@/lib/utils";
2import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar";
3
4function Avatar({ className, ...props }: AvatarPrimitive.Root.Props) {
5 return (
6 <AvatarPrimitive.Root
7 data-slot="avatar"
8 className={cn(
9 "relative flex size-8 shrink-0 overflow-hidden rounded-full",
10 className
11 )}
12 {...props}
13 />
14 );
15}
16
17function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
18 return (
19 <AvatarPrimitive.Image
20 data-slot="avatar-image"
21 className={cn("aspect-square size-full", className)}
22 {...props}
23 />
24 );
25}
26
27function AvatarFallback({
28 className,
29 ...props
30}: AvatarPrimitive.Fallback.Props) {
31 return (
32 <AvatarPrimitive.Fallback
33 data-slot="avatar-fallback"
34 className={cn(
35 "bg-muted flex items-center justify-center size-full rounded-full text-sm",
36 className
37 )}
38 {...props}
39 />
40 );
41}
42
43export { Avatar, AvatarImage, AvatarFallback };

What it pulls in

npm packages

  • @base-ui/react

Files it writes

  • src/registry/components/ui/avatar.tsx

Facts

Registry
basecn
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on basecn basecn.dev akash3444/basecn on GitHub Raw registry item This item as JSON

More from basecn

All 56 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordionbasecnComponentsFree2 deps
AlertalertbasecnComponentsFree1 dep
Alert Dialogalert-dialogbasecnComponentsFree1 dep
Aspect Ratioaspect-ratiobasecnComponentsFreeno deps
AutocompleteautocompletebasecnComponentsFree2 deps
BadgebadgebasecnComponentsFree2 deps
BreadcrumbbreadcrumbbasecnComponentsFree2 deps
ButtonbuttonbasecnComponentsFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex