🛠️ VitNode is still in development! You can try it out, but it is not recommended to use it now in production.
🖌️ Themes
Components
User
Avatar

Avatar

To use the Avatar component you have to import from @/components/user/avatar/avatar-user. Component requires sizeInRem prop to be passed.

ℹ️

1rem === 16px

Current User

If you want to display the user avatar, you need to pass User object.

import { AvatarUser } from "@/components/user/avatar/avatar-user";
 
<AvatarUser
  user={{
    avatar,
    name,
    id,
    avatar_color
  }}
  sizeInRem={1.75}
/>;

Current User

If you want to display the user avatar, you need to pass a user object form useSession or useSessionAdmin (if you want to use in AdminCP) hook.

import { AvatarUser } from "@/components/user/avatar/avatar-user";
import { useSession } from "@/hooks/core/use-session";
 
const { session } = useSession();
if (!session) return null;
 
return <AvatarUser user={session} sizeInRem={1.75} />;

Props

NameTypeDefaultDescription
user (Required)UserUser object
sizeInRem (Required)number1.75Size of the avatar