Pre-alphaThe registry and the CLI are not published yet.Roadmap
Compositions

Profile Card

Avatar, name, short bio, stats and follow and message buttons.

Suggested

LM
Lena Moreau@lena.m
Product designer in Lyon. Sketching interfaces, shooting film, drinking too much coffee.
248Posts
12.4kFollowers
310Following
Follow
Message
SO
Sam Okafor@samok
86Posts
1,204Followers
97Following
Following
Message

The second card has no photo: the avatar falls back to the initials, on a hue taken from the name. Its follow button is in the “Following” state.

Installation

npx axiom add profile-card
pnpm dlx axiom add profile-card
yarn dlx axiom add profile-card
bun x axiom add profile-card

Also copies: card, avatar, separator, button, title, text and their dependencies. The file lands in components/compositions/profile-card.tsx. It brings no tokens of its own.

Usage

The card doesn’t keep the follow state. Hold it in the screen and flip following in onFollow:

import { useState } from "react";

import { ProfileCard } from "@/components/compositions/profile-card";

const [following, setFollowing] = useState(user.isFollowed);

<ProfileCard
	name={user.name}
	handle={`@${user.username}`}
	avatar={{ uri: user.avatarUrl }}
	bio={user.bio}
	stats={[
		{ value: "248", label: "Posts" },
		{ value: "12.4k", label: "Followers" },
		{ value: "310", label: "Following" },
	]}
	following={following}
	onFollow={() => setFollowing((value) => !value)}
	onMessage={() => router.push(`/messages/${user.id}`)}
	onPress={() => router.push(`/users/${user.id}`)}
/>;

Props

PropTypeDefaultDescription
namestring—Shown as the title. Gives the avatar its initials and hue when there is no photo.
handlestring—Under the name, muted: "@lena.m".
avatarImageSourcePropType—The photo, in an xl Avatar. The initials show while it loads or if it fails.
biostring—Centered, up to three lines.
statsProfileStat[]—{ value, label }, already formatted: "12.4k". Between lines, each read as “12.4k Followers”. Three fit.
followingbooleanfalseSwaps the follow button to its outlined “Following” state.
followLabelstring"Follow"Label of the follow button.
followingLabelstring"Following"Label of the follow button when following.
onFollow() => void—Shows the follow button. Without it, there is none.
messageLabelstring"Message"Label of the message button.
onMessage() => void—Shows the outlined message button, next to the follow button.
onPress() => void—Makes the whole card pressable, to open the profile. The buttons keep their own press.
styleStyleProp<ViewStyle>—Extra styles for the card container, for example a margin.

Built with

  • Card: the elevated surface and its header.
  • Avatar: the photo, or the initials on a hue from the name.
  • Title: the name and the stat values.
  • Text: the handle, the bio and the stat labels.
  • Separator: the lines between the stats.
  • Button: follow in solid, or outline once followed, and message in outline.

Used in

No block uses Profile Card yet.