jbmui

UiCard

  • UI Bits

Illustrated content card with a line-art picture (hills and a vermilion sun) over two text bars.

Install

npx shadcn@latest add @jbm/ui-card

Needs the @jbm entry in components.json; see Install once.

Also installs @jbm/tokens, @jbm/paper.

Usage

Card at its default size
import { UiCard } from "@/jbm/ui/ui-card"<UiCard w={220} h={170} />
Card inside a phone
import { UiCard } from "@/jbm/ui/ui-card"import { PhoneFrame } from "@/jbm/ui/phone-frame" // install @jbm/phone-frame separately<PhoneFrame w={200} h={360} gap={14}>  <UiCard w={130} h={100} /></PhoneFrame>

Props

Stage px
Declared at the documented defaults
Landscape
220 by 170
Vertical
220 by 170
Basis

Fixed w × h box (border-box) at the defaults 220 × 170. w and h set it directly; the Paper shadow extends below the box.

Cream paper card with an ink outline: an SVG picture slot taking half the height, then an ink title bar and a lighter subtitle bar. Padding (7% of w), radius (8% of w), and gaps (7% of h) all scale with the box. Pure React; static.

PropTypeDefaultDescription
wnumber220Width in stage pixels, including the 2px Paper edge; sets padding, radius, and bar widths.
hnumber170Height in stage pixels; the picture is 50% of it and the bar thicknesses follow it.
styleReact.CSSPropertiesnoneInline styles merged over the card's column layout; use for positioning or opacity.

QA checks

  • Inspect the picture slot: the picture width is computed as w minus padding without the 2px edges, so it may sit about 2px right of centre; confirm this is acceptable at large w.
  • Try a short, wide card (h well below 0.7 × w): the picture, gaps, and two bars must still fit inside the fixed height.
  • Check the single vermilion sun stays the only accent when the card sits next to other accent pieces.