Home / File/ avatar.tsx — ui Source File

avatar.tsx — ui Source File

Architecture documentation for avatar.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 3 functions

Entity Profile

Dependency Diagram

graph LR
  012719cb_a0b0_094d_6922_4b9cec8df41c["avatar.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  012719cb_a0b0_094d_6922_4b9cec8df41c --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  27bdd14c_84b8_6a47_a1cd_5971bfab380d["react-avatar"]
  012719cb_a0b0_094d_6922_4b9cec8df41c --> 27bdd14c_84b8_6a47_a1cd_5971bfab380d
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  012719cb_a0b0_094d_6922_4b9cec8df41c --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  style 012719cb_a0b0_094d_6922_4b9cec8df41c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import * as AvatarPrimitive from "@radix-ui/react-avatar"

import { cn } from "@/lib/utils"

const Avatar = React.forwardRef<
  React.ElementRef<typeof AvatarPrimitive.Root>,
  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
>(({ className, ...props }, ref) => (
  <AvatarPrimitive.Root
    ref={ref}
    className={cn(
      "relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
      className
    )}
    {...props}
  />
))
Avatar.displayName = AvatarPrimitive.Root.displayName

const AvatarImage = React.forwardRef<
  React.ElementRef<typeof AvatarPrimitive.Image>,
  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
>(({ className, ...props }, ref) => (
  <AvatarPrimitive.Image
    ref={ref}
    className={cn("aspect-square h-full w-full", className)}
    {...props}
  />
))
AvatarImage.displayName = AvatarPrimitive.Image.displayName

const AvatarFallback = React.forwardRef<
  React.ElementRef<typeof AvatarPrimitive.Fallback>,
  React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
>(({ className, ...props }, ref) => (
  <AvatarPrimitive.Fallback
    ref={ref}
    className={cn(
      "flex h-full w-full items-center justify-center rounded-full bg-muted",
      className
    )}
    {...props}
  />
))
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName

export { Avatar, AvatarImage, AvatarFallback }

Subdomains

Dependencies

  • react
  • react-avatar
  • utils

Frequently Asked Questions

What does avatar.tsx do?
avatar.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in avatar.tsx?
avatar.tsx defines 3 function(s): Avatar, AvatarFallback, AvatarImage.
What does avatar.tsx depend on?
avatar.tsx imports 3 module(s): react, react-avatar, utils.
Where is avatar.tsx in the architecture?
avatar.tsx is located at deprecated/www/registry/default/ui/avatar.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/ui).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free