jbmui

Document

  • UI Bits

Folded paper illustration with optional label and accent heading.

borrador.mdidea.md

Install

npx shadcn@latest add @jbm/document

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

Also installs @jbm/tokens.

Docs

Usage

Labelled accent document
import { Document } from "@/jbm/ui/document"<Document label="idea.md" accent style={{ width: 180 }} />
Decorative pair, one tilted
import { Document } from "@/jbm/ui/document"<div style={{ display: "flex", gap: 24 }}>  <Document style={{ width: "42%" }} />  <Document label="borrador.md" style={{ width: "42%", transform: "rotate(4deg)" }} /></div>

Props

Stage px
Declared at the documented defaults
Landscape
160 by 200
Vertical
160 by 200
Basis

Fixed 160×200 viewBox rendered at width 160 and height 200 stage pixels. The style sets height auto and maxWidth 100%, so set style.width to scale it with its 4:5 proportions; other SVG attributes pass through.

Static SVG sheet with a folded top-right corner, a heading stroke, three grey text lines, and an optional mono label. Without a label it is decorative (aria-hidden); with one it is an image named by the label.

PropTypeDefaultDescription
labelstringnoneMono filename printed near the bottom edge; also the accessible name. Truncated to 15 characters plus an ellipsis when longer than 16. Omit for a decorative sheet.
accentbooleanfalseDraws the heading stroke in vermilion instead of ink.

Also accepts React.SVGProps<SVGSVGElement>.

QA checks

  • Compare accent and ink headings: only the heading stroke changes color.
  • Try a label longer than 16 characters: it ends with an ellipsis and stays inside the sheet.
  • Scale with style.width at narrow widths: the fold and ink edge (stroke.outline) keep their 160:200 proportions.
  • Without a label the SVG is aria-hidden; with one it exposes role img and the label as its name.