jbmui

PaperLine

  • UI
  • adjustable

Line of text with controlled grapheme reveal, ink lift, strike-through, and dotted underline.

Una idea, bien explicada.

Install

npx shadcn@latest add @jbm/paper-line

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

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

Docs

Usage

Partly written line
import { PaperLine } from "@/jbm/ui/paper-line"<PaperLine text="Una idea clara." reveal={0.7} lift={0} strike={0} />
Crossed-out mono note
import { PaperLine } from "@/jbm/ui/paper-line"<PaperLine text="v1 descartada" mono dotted strike={1} style={{ fontSize: 22 }} />

Props

Stage
fluid

Inline-block text at the inherited font size with line-height 1.4; width follows the text up to 100% of the container and height grows when it wraps. Lift translates up to 60px right and 40px up without affecting layout, so leave headroom (the gallery pads 32px above).

Inline-block line of handwritten-on-paper text. Every progress input is controlled 0–1 (clamped; non-finite values count as 0) with no timer, so a slider or video timeline drives it. Hidden graphemes keep their space, and a visually hidden copy exposes the full text to assistive technology.

PropTypeDefaultDescription
textstringrequiredThe line's text; revealed by whole graphemes (emoji and combined characters stay intact).
revealnumber1Share of graphemes shown, 0–1; visible count is ceil(reveal × graphemes). The full footprint is reserved at every value.
liftnumber0Ink lift 0–1: the line moves up to 60px right and 40px up, rotates up to −9°, and fades (opacity 1 − lift²).
strikenumber0Vermilion 2px strike-through across the middle, drawn left to right as 0–1 of the line width. Meant for single short lines.
dottedbooleanfalseAdds a 2px dotted underline in the dim color.
accentbooleanfalseUses the vermilion accent for the text instead of ink.
monobooleanfalseUses the mono font stack instead of sans.
styleCSSPropertiesnoneInline styles merged last onto the outer span, e.g. fontSize or fontWeight (both inherit by default).

QA checks

  • Drag Reveal from 0 to 1: graphemes appear left to right, the line never changes width, and 0 shows nothing.
  • Drag Lift ink to 1: the line drifts up-right, tilts, and fades out completely without overlapping controls.
  • Drag Strike to 1 on a single line; on a wrapped line the stroke sits at the block's vertical middle, so keep struck lines short.
  • Toggle Dotted underline and Accent ink independently, and check each combination with mono.