CraftUI

Profile Panel

A player's profile, with a preview space, avatar, name and status, actions, statistics and other details.

SK

Skylark

Online
Friends
3
Followers
230
Achievements
130 / 131
2,950 / 2,960
Joined
March 2021
Favorite mode
Survival
Time played
412 hours

Installation

npx shadcn@latest add @runqora/craft-profile-panel

Usage

import {
  ProfileActions,
  ProfileAvatar,
  ProfileHeader,
  ProfileIdentity,
  ProfileName,
  ProfilePanel,
  ProfilePreview,
  ProfileStat,
  ProfileStats,
  ProfileStatus,
} from "@/components/craft/profile-panel";

<ProfilePanel>
  <ProfilePreview>
    <img alt="" src="/character.png" />
  </ProfilePreview>
  <ProfileHeader>
    <ProfileAvatar fallback="SK" src="/avatar.png" />
    <ProfileIdentity>
      <ProfileName>Skylark</ProfileName>
      <ProfileStatus status="online" />
    </ProfileIdentity>
  </ProfileHeader>
  <ProfileActions>
    <Button variant="secondary">Dressing room</Button>
  </ProfileActions>
  <ProfileStats>
    <ProfileStat label="Friends" value="3" />
  </ProfileStats>
</ProfilePanel>;

Props

ProfileStat

Prop

Type

ProfileStatus

Prop

Type

ProfileAvatar

Prop

Type

Accessibility

  • The name is a heading, so a profile can be found by its headings.
  • The status is a colored square and words, such as "Online", so it doesn't rely on color.
  • Each statistic and detail is a term and its value, read together.
  • The avatar's image has an empty alt by default, because the name is beside it.

Customization

ProfilePreview is an empty space for a picture of the player or their character: an <img>, a video, or a renderer of your own. CraftUI doesn't draw characters.

The parts can go in one panel or be split across several, as in the example. ProfileStatus takes online, away, busy or offline, and its words can be replaced, such as "In a game".

Dependencies

Source

On this page