BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/adn-ui/avatar

Avatar

adn-ui/avatar
FreeComponent

An easily stylable avatar component for profile images and fallbacks.

Live preview

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

Install it

npx shadcn@latest add https://ui.awaiden.com/r/avatar.json

Source

src/components/ui/avatar/avatar.tsxui.awaiden.com/r/avatar.json
1"use client";
2
3import "./avatar.css";
4import { Avatar as BaseAvatar } from "@base-ui/react/avatar";
5import type React from "react";
6import { cn } from "tailwind-variants";
7
8import { AvatarContext, useAvatarContext } from "./avatar.context";
9import { avatarVariants, type AvatarVariants } from "./avatar.variants";
10
11export type AvatarProps = AvatarVariants & React.ComponentProps<typeof BaseAvatar.Root>;
12
13export const AvatarRoot = ({ children, className, shape, size, ...props }: AvatarProps) => {
14 const slots = avatarVariants({ shape, size });
15
16 return (
17 <AvatarContext.Provider value={{ slots }}>
18 <BaseAvatar.Root className={cn(slots.root(), className)} {...props}>
19 {children}
20 </BaseAvatar.Root>
21 </AvatarContext.Provider>
22 );
23};
24
25export type AvatarImageProps = React.ComponentProps<typeof BaseAvatar.Image>;
26
27export const AvatarImage = ({ className, ...props }: AvatarImageProps) => {
28 const { slots } = useAvatarContext();
29 return <BaseAvatar.Image className={cn(slots.image(), className)} {...props} />;
30};
31
32export type AvatarFallbackProps = React.ComponentProps<typeof BaseAvatar.Fallback>;
33
34export const AvatarFallback = ({ className, ...props }: AvatarFallbackProps) => {
35 const { slots } = useAvatarContext();
36 return <BaseAvatar.Fallback className={cn(slots.fallback(), className)} {...props} />;
37};

What it pulls in

npm packages

  • @base-ui/react
  • tailwind-variants

Files it writes

  • src/components/ui/avatar/avatar.tsx
  • src/components/ui/avatar/avatar.variants.ts
  • src/components/ui/avatar/avatar.context.ts
  • src/components/ui/avatar/avatar.css
  • src/components/ui/avatar/index.ts

Facts

Registry
adn-ui
Type
registry:ui
Access
Free
Files written
5
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

Docs on adn-ui ui.awaiden.com awaiden/adn-ui on GitHub Raw registry item This item as JSON

More from adn-ui

All 46 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionadn-uiComponentsFree2 deps · 5 files
Alert Dialogalert-dialogadn-uiComponentsFree2 deps · 5 files
Aspect Ratioaspect-ratioadn-uiComponentsFree1 dep · 5 files
Autocompleteautocompleteadn-uiComponentsFree2 deps · 5 files
Badgebadgeadn-uiComponentsFree1 dep · 5 files
Breadcrumbbreadcrumbadn-uiComponentsFree1 dep · 5 files
Buttonbuttonadn-uiComponentsFree1 dep · 4 files
Button Groupbutton-groupadn-uiComponentsFree1 dep · 5 files
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