jbmui

Card

  • UI

Raised surface with a fine border, layered depth, and inset edge light.

Light
Canvas
Dark
Surface

Install

npx shadcn@latest add @jbm/card

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

Also installs @jbm/tokens.

Docs

Usage

Dark card with a headline
import { Card } from "@/jbm/ui/card"import { color } from "@/jbm/lib/tokens"import { Big } from "@/jbm/ui/big" // install @jbm/big separately<Card dark><Big color={color.bg}>Surface</Big></Card>

Props

Stage
fluid

Width fills its container and height follows the children. The card adds 40px padding and a 1px border on each side (82 stage pixels over the content); set style.width or style.height for a fixed box.

Card-stock (or dark) container with the shared surface border, card shadow, 28px radius, and 40px padding.

PropTypeDefaultDescription
childrenReact.ReactNoderequiredCard content.
styleReact.CSSPropertiesnoneInline styles merged last; use for width, height, or layout, not for new shadows.
darkbooleannoneUses the dark code-card fill with the dark border and shadow tokens.

QA checks

  • Compare the light and dark surfaces on cream: fine border, layered shadow, and the inset highlight on the upper edge.
  • Check that content-driven height plus the 82px of padding and border still fits the safe area.