jbmui

UiButton

  • UI Bits

Illustrated pill button with a label bar, in ink, accent, or outlined paper tones.

Install

npx shadcn@latest add @jbm/ui-button

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

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

Usage

Accent button
import { UiButton } from "@/jbm/ui/ui-button"<UiButton w={220} h={70} tone="accent" />
Outlined button in a paper row
import { UiButton } from "@/jbm/ui/ui-button"<div style={{ display: "flex", gap: 24 }}>  <UiButton w={180} h={56} tone="paper" />  <UiButton w={180} h={56} /></div>

Props

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

Fixed w × h box (border-box, so the 2px edge is inside) at the defaults 220 × 70. w and h set it directly; the Paper shadow extends past the box by up to about 32px below.

Paper cut-out pill (radius h / 2) with a centred rounded bar standing in for the label. The bar is 42% of the width and 13% of the height (at least 6px); it is cream on ink and accent, ink on paper. Pure React with no text and no click handling: an illustration, not a control.

PropTypeDefaultDescription
wnumber220Width in stage pixels, including the 2px Paper edge.
hnumber70Height in stage pixels; also sets the pill radius (h / 2) and the label bar thickness.
tonePaperTone"ink"Paper stock: ink (default, filled), accent (vermilion), or paper (cream with an ink outline and ink bar).
styleReact.CSSPropertiesnoneInline styles merged over the flex centring; use for positioning, opacity, or transforms.

QA checks

  • Compare ink, accent, and paper tones on cream: the paper tone keeps its 2px ink outline and ink bar; ink and accent show a cream bar.
  • Check extremes of h: at small heights the bar floors at 6px thick; at large heights the pill stays fully rounded.
  • Confirm the bar stays centred when style adds padding or positioning.