ClippedNote
Paper note with an optional paper clip, rotation, and paper, accent, or ink stock.
Lo que necesita de ti, arriba.
Install
npx shadcn@latest add @jbm/clipped-noteNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens, @jbm/paper, @jbm/paper-clip.
Usage
import { ClippedNote } from "@/jbm/ui/clipped-note"<ClippedNote clip rotate={-3}>Revisar el resultado.</ClippedNote>import { ClippedNote } from "@/jbm/ui/clipped-note"import { PaperTape } from "@/jbm/ui/paper-tape" // install @jbm/paper-tape separately<PaperTape length={700} window={280} attachments={[{ id: "note", at: 650, content: <ClippedNote style={{ width: 108, fontSize: 12, padding: 10 }}>12 de 30 rutas</ClippedNote> }]} />Props
- Stage
fluidWidth is 220px (maxWidth 100%) unless style overrides it; height follows the wrapped children plus 36px padding and a 4px border. The clip adds 24px above the top edge, and rotation enlarges the visual footprint.
Composes Paper (10px radius, 18px padding, 220px wide up to 100% of its container) and PaperClip. Children render in bold sans with ink matched to the stock and wrap anywhere.
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | required | Note content. |
clip | boolean | true | Shows the paper clip across the top edge at left 18px, top −24px. The clip extends above the note's box. |
tone | PaperTone | "paper" | Paper stock: paper (card with ink text), accent (vermilion), or ink; text switches to cream on accent and ink. |
rotate | number | 0 | Rotation of the whole note, clip included, in degrees. |
style | CSSProperties | none | Inline styles merged last onto the Paper, e.g. width, padding, or font size. |
QA checks
- Toggle Paper clip: the note does not shift, and the clip overlaps the top edge rather than floating above it.
- Toggle Accent paper and try ink: text stays legible on each stock.
- Drag Note rotation to both extremes: the clip rotates with the note and nothing is clipped by the preview.
- Check a long unbroken word wraps inside the 220px width on narrow screens.