Card
Raised surface with a fine border, layered depth, and inset edge light.
Light
Canvas
Dark
Surface
Install
npx shadcn@latest add @jbm/cardNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens.
Usage
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
fluidWidth 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.
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | required | Card content. |
style | React.CSSProperties | none | Inline styles merged last; use for width, height, or layout, not for new shadows. |
dark | boolean | none | Uses 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.