Xzero UI
Pro library

Profile pagePro

A user profile with cover, bio, stats, activity and project tabs, and an edit sheet that writes back into the page.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/profile-page
Live · keyboard ready

Use this for member or creator profiles. Load the profile, stats, activity, and projects from your API, save edits through onSave, and persist stars through onStarChange; saving in the preview is simulated.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/profile-page

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { ProfilePage } from "@/components/xzero/blocks/profile-page/profile-page";

export function Profile({ user, activity, projects }) {
  return (
    <ProfilePage
      profile={user}
      activity={activity}
      projects={projects}
      onSave={async next => {
        const res = await fetch("/api/me", { method: "PATCH", body: JSON.stringify(next) });
        if (!res.ok) throw new Error("Could not save your profile.");
      }}
    />
  );
}

API reference

ProfilePage

A full profile screen: cover photo, overlapping avatar, name and headline, an about column with bio, links, and stats, and Activity and Projects tabs. Edit profile slides a sheet in from the right edge; saving writes the changes back into the page and briefly highlights every field that changed.

PropTypeDefaultDescription
profileProfileDetailssample profileName, handle, headline, location, website, bio, avatar and cover image paths, and the joined label.
statsProfileStat[]sample statsUp to three counts shown under the bio, each with an id, label, and value.
activityProfileActivity[]sample activityActivity items with a kind (shipped, commented, created, reviewed, starred), action text, target, optional detail, time, and a group heading such as This week.
projectsProfileProject[]sample projectsProject cards with a cover image, description, visibility, collaborators, updated label, and star count.
tab"activity" | "projects"–Controlled tab. Pair with onTabChange.
defaultTab"activity" | "projects""activity"Tab shown on mount when uncontrolled.
onTabChange(tab: ProfileTab) => void–Called when the tab changes.
onSave(profile: ProfileDetails) => void | Promise<void>–Persists edited details. Throw an Error to keep the sheet open and show its message. Without it the preview simulates a save.
onStarChange(projectId: string, starred: boolean) => void–Called when a project star is toggled.
profileUrlstring"https://northwind.app/@<handle>"Public link copied by Share.
editablebooleantrueShows Edit profile. Set false when someone views another person's profile.
classNamestring–Extra class on the root.

Keyboard interactions

KeysAction
TabMoves through Share, Edit profile, links, tabs, and project stars.
Arrow left / Arrow rightSwitch between the Activity and Projects tabs.
EscapeCloses the edit sheet without saving and returns focus to Edit profile.
EnterSaves the edit sheet from any single line field.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components