ProfileCard

Grainy mesh banner that drifts with the pointer, rolling stats and a Follow button that morphs. Following is optimistic: it updates at once and rolls back if your request fails. Cards.

Open playground

Mara Okonkwo

Product designer

Designing calm tools for busy teams.

0
Followers
0
Following
0
Shots

About

ProfileCard is a React component in the Cards category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { ProfileCard } from "@ashutoshswamy/smoui" and set name, avatar, palette among its 8 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { ProfileCard } from "@ashutoshswamy/smoui";

<ProfileCard
  name="Mara Okonkwo"
  role="Product designer"
  stats={[{ label: "Followers", value: 2480 }, { label: "Shots", value: 87 }]}
  onFollow={(on) => console.log(on)}
/>

// <ProfileCard variant="compact" name="..." role="..." />

Props 8

name / role / bio

Text content.

string
avatar

Photo URL. Without one, a mesh avatar is generated from the name.

string
palette

0-7, picks the mesh colors. Defaults to a hash of the name.

number
stats

Counted stats. A stat labelled Followers ticks up when you follow.

{ label: string; value: number }[]
variant

Compact is a single row.

"banner""compact"default "banner"
banner

Banner image URL. Without one, the grainy mesh is used.

string
following / defaultFollowing

Controlled or initial follow state.

boolean
onFollow

Return a promise to get optimistic updates: the card shows the new state now and rolls back if it rejects.

(on: boolean) => void | Promise<unknown>