jbmui

Stamp

  • UI Bits
  • adjustable

Vermilion rubber-stamp impression that drops, makes contact, and inks in as a 0–1 press progresses.

REVISADO

Install

npx shadcn@latest add @jbm/stamp

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

Also installs @jbm/tokens, @jbm/scene-geometry.

Docs

Usage

Nearly settled stamp
import { Stamp } from "@/jbm/ui/stamp"<Stamp text="REVISADO" press={0.9} angle={-7} />

Props

Stage
fluid

Inline-block sized by the text: one 24px mono line plus 8px/16px padding and a 3px border, up to 100% of the container. Before contact it sits up to 60px higher, and rotation widens the footprint, so reserve headroom (the gallery pads 70px above).

Bordered mono text in vermilion with a faint offset second impression. An ink impression, not a validation verdict. press is controlled with no timer: the stamp descends from 60px above until contact at 0.62, and its ink fades in from 0.5 to fully opaque at 0.8.

PropTypeDefaultDescription
textstringrequiredImpression text in 24px bold mono; wraps anywhere when space runs out.
pressnumber1Press progress 0–1 (clamped). Invisible below 0.5, touches down at 0.62, fully inked from 0.8.
anglenumber-7Rotation of the impression in degrees; negative tilts counter-clockwise.
styleCSSPropertiesnoneInline styles merged last onto the outer element. Setting transform or opacity here replaces the press animation.

QA checks

  • Drag Press through 0, 0.5, 0.62, 0.8, and 1: hidden, faint while descending, touching down, fully inked, and settled with no jump.
  • Drag Stamp angle to both extremes: the rotated box stays inside the preview on narrow screens.
  • Check the offset second impression reads as ink texture, not a duplicate label, and screen readers hear the text once.