Patterns
Membership Card
A physical-feeling membership card — inverted lit surface, ambient glows, corner watermark, hover sweep and a row of figures.
A physical-feeling membership card: an inverted, lit surface with ambient glows, a watermark bled off the corner, a light sweep on hover, and a row of figures along the bottom.
Extracted class for class from Yunxin's Fellows landing page, where it is the tangible centrepiece of the pitch — Yunxin is the original and stays the reference, so a page that adopts this renders exactly what its local copy did.
Import
tsx
1import { MembershipCard } from "@yuhuanowo/yunui/patterns";Usage
Every region is optional: pass only brand and status for a plain card, or fill all of them for the full object.
Membership card
Yunxin FellowsFellow
Membership
Active — renews in 24 days
5M
per month
170+
models
120
req / min
Why it looks the way it does
- Theme-adaptive, not a fixed dark card. The surface is
bg-foreground/80withtext-background, so it inverts with the theme and stays striking in light and dark — the same trick as the system's solid buttons. aspect-[1.586/1]is the real credit-card ratio. The element isblockwithmx-autorather than a flex child, so a flex parent cannot stretch or collapse that box.- The glows are the surface. Two blurred radial patches, not borders — a lit object rather than a panel with lines drawn on it.
tabular-numson the figures, so three stats side by side line up instead of jittering as the numbers load.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| badge | { label: ReactNode; icon?: ReactNode; } | — | Tier pill, top-right. |
| brand | ReactNode | — | Programme name, top-left — e.g. "Yunxin Fellows". |
| chip | boolean | true | The little contactless-chip rectangle beside the status. |
| label | ReactNode | — | Small uppercase caption above the status line. |
| stats | MembershipCardStat[] | [] | Up to three figures along the bottom. |
| status | ReactNode | — | The membership's headline state — "Active", "Renews in 12 days". |
| watermark | ReactNode | — | A large glyph bled off the bottom-right corner at 6% opacity. Pass a lucide icon sized `w-48 h-48`; the component positions it. |