# VideoPrint (video-print)

> A printed video still on a Paper sheet: a pale 16:9 line sketch, an ink scrub rule with anchor ticks, title and date, and an optional punched link tag.

- Entry: component
- Category: UI Bits
- Preview capabilities: controls
- Runtime: React
- Needs Remotion: no
- QA page: https://jbm-ui.bns.studio/c/video-print
- JSON: https://jbm-ui.bns.studio/catalog/video-print.json
- Registry item: https://jbm-ui.bns.studio/r/video-print.json (source code in files[].content)

## Install

```sh
npx shadcn@latest add @jbm/video-print
```

Also installs @jbm/tokens, @jbm/scene-geometry, @jbm/paper, @jbm/punched-tag (registry dependencies install automatically).

## Required setup

1. Add the `@jbm` registry to components.json (keep any entries already there):

   ```json
   {
     "registries": {
       "@jbm": "https://jbm-ui.bns.studio/r/{name}.json"
     }
   }
   ```

2. Map `@/*` to `./src/*` in tsconfig.json `compilerOptions.paths`, so `@/jbm/…` imports resolve to src/jbm/.

## Files

Each file's source code is in the registry item JSON (https://jbm-ui.bns.studio/r/video-print.json, files[].content).

| Source path | Installs to | Import |
| --- | --- | --- |
| `registry/jbm/ui/video-print.tsx` | `src/jbm/ui/video-print.tsx` | `@/jbm/ui/video-print` |

## API

### `VideoPrint` (component)

A Paper sheet (radius 10, ink edge, paper shadow) carrying a 16:9 frame in pale ink (an opaque 8% ink-on-card tint, identical with or without the sheet, and an ink outline at the shared outline weight, the same as the sheet edge at every w) with a head-and-shoulders line sketch, a pale scrub track whose ink bar advances with `scrub`, ink ticks at the marks the bar has passed, the title (Geist 700) and date (Geist, Graphite), and, when `link` is set, a PunchedTag with the URL in Geist Mono hanging over the bottom edge. Composes Paper and PunchedTag unchanged. Controlled; no timers.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `scrub` | `number` | required | Playhead 0–1: how far the ink scrub bar has advanced along the rule. Clamped; NaN is 0. |
| `marks` | `readonly number[]` | `[]` | Positions 0–1 along the rule. A mark leaves an ink tick once scrub reaches it; its anchor point exists from the start (videoPrintLayout().marks), so a thread can tie on as the tick appears. |
| `title` | `string` | required | The video's title in bold type under the rule; one line, ellipsis when long. |
| `date` | `string` | required | The line under the title, usually source and date ("Video · 4 nov 2025"). |
| `link` | `string` | none | A URL set in mono on a punched tag straddling the bottom edge: the sign that this page was opened. One line; a URL longer than the print ends in an ellipsis, so the tag never passes the sheet's right edge. Omit for a print nobody opened. |
| `opened` | `number` | `1` | 0–1: the tag fades in over the first half and settles up 8 × w/480 px into place from just below its resting spot, so it never rises past it or crosses the date line. Only used with link; 0 hides it. |
| `w` | `number` | `BASE` | Width in stage pixels (default 480). Everything scales with it; the height is 0.765 × w. |
| `sheet` | `boolean` | `true` | Draw the Paper sheet (default). false keeps the same layout, anchors, and still tint without the sheet, for nesting on a Paper you already have. |
| `style` | `CSSProperties` | none | Inline styles merged onto the outer box, e.g. position and left/top on a stage. |

### `videoPrintLayout` (function)

Where everything on the print sits, so Hilo threads and hands can reach it. Pass the print's stage position as `at` to get stage coordinates.

| Parameter | Type | Default | Description |
| --- | --- | --- | --- |
| `link` | `string` | none | The URL, when the print carries a link tag; only its presence matters here. |
| `w` | `number` | `BASE` | Print width in stage pixels (default 480); the layout scales with it. |
| `marks` | `readonly number[]` | `[]` | Positions 0–1 along the scrub rule. |
| `at` | `Pt` | `{ x: 0, y: 0 }` | The print's top-left corner on your stage (default { x: 0, y: 0 }); every returned point is offset by it. |

Returns: { scale, w, h, pad, frame: { x, y, w, h }, rule: { x, y, w }, titleY, dateY, marks: Pt[], tag: Pt | null, tagX, tagMaxW, bounds: { w, h } }. marks[i] is mark i's point on the rule's centreline; tag is the punched hole's centre (on the sheet's bottom edge), or null without a link; tagMaxW is the tag's widest extent from tagX (it stops a padding short of the sheet's right edge); bounds is the box everything draws in, the sheet plus, with a link, the half of the tag that hangs below it.

### `VideoPrintProps` (type)

Props of VideoPrint.

## Stage

Declared in stage pixels at the documented defaults.

| Orientation | Width | Height |
| --- | --- | --- |
| Landscape (1920×1080) | 480 | 394 |
| Vertical (1080×1920) | 480 | 394 |

At the default w 480: 22px padding, a 436 × 245.25 frame, the rule 12px under it, the title 18px under the rule, the date 30px under the title, then 18 + 22px: a 367.25px sheet. With link, the tag straddles the bottom edge and half of it (15.1 × w/480 + the 3px outline) hangs below, plus the 8 × w/480 it settles up from while `opened` is below 1: 393.35px in all, declared as 394. Every measurement scales with w (sheet height = 0.765 × w); videoPrintLayout().bounds gives the exact box. The tag never extends past the right edge: long URLs end in an ellipsis.

## Examples

### Video print with an opened link

```tsx
import { VideoPrint } from "@/jbm/ui/video-print"

<VideoPrint
  scrub={1}
  title="Sample talk"
  date="Video · 4 nov 2025"
  link="example.com/watch?v=sample-talk"
/>
```

### Tie a thread to a scrub tick

```tsx
import { VideoPrint, videoPrintLayout } from "@/jbm/ui/video-print"
import { Hilo } from "@/jbm/ui/hilo" // install @jbm/hilo separately

declare const scrub: number
const at = { x: 1200, y: 300 }
const marks = [0.2, 0.45, 0.7]
const tick = videoPrintLayout({ marks }, at).marks[1]
<div style={{ position: "relative", width: 1920, height: 1080 }}>
  <VideoPrint scrub={scrub} marks={marks} title="Sample talk" date="Video · 4 nov 2025" style={{ position: "absolute", left: at.x, top: at.y }} />
  <svg viewBox="0 0 1920 1080" style={{ position: "absolute", inset: 0 }}>
    <Hilo from={tick} to={{ x: 520, y: 400 }} curve="s" bend={0.5} draw={scrub >= 0.45 ? 1 : 0} />
  </svg>
</div>
```

## QA

- Drag Scrub from 0 to 1: the ink bar grows from the left edge of the frame, each tick appears exactly when the bar reaches it, and nothing inks ahead of the bar.
- The frame reads as a pale sketch (tinted fill, ink outline, head circle and shoulder arc), never a solid ink block; compare with the video and puertas board panels.
- Toggle the link and drag Tag drops in: the mono URL tag straddles the bottom edge, its hole ringed in ink and scaled with the print (PunchedTag scale = w/480), and stays inside the declared bounds; a long URL ends in an ellipsis instead of wrapping or passing the sheet's right edge. At every step of the drop the tag's top edge stays below the date line, and at Half it is opaque.
- Turn the sheet off: the frame, rule, and type keep their positions (anchors unchanged), and the still keeps exactly the same tint.
- Check a thread tied to videoPrintLayout().marks lands on the tick centreline, at w 300 and 480.
- The print uses no vermilion of its own.

## Family

Paper & writing

## Docs

- [Paper and filing illustrations guide](https://jbm-ui.bns.studio/docs/design-video-components.md)

## Related

Installs:

- [Tokens (tokens)](https://jbm-ui.bns.studio/catalog/tokens.md)
- [SceneGeometry (scene-geometry)](https://jbm-ui.bns.studio/catalog/scene-geometry.md)
- [Paper (paper)](https://jbm-ui.bns.studio/catalog/paper.md)
- [PunchedTag (punched-tag)](https://jbm-ui.bns.studio/catalog/punched-tag.md)

Imported in examples:

- [Hilo (hilo)](https://jbm-ui.bns.studio/catalog/hilo.md)

## More

- [llms.txt](https://jbm-ui.bns.studio/llms.txt): index of every item
- [catalog.json](https://jbm-ui.bns.studio/catalog.json): every item as JSON
- [Agent contract](https://jbm-ui.bns.studio/docs/agent-contract.md): what each field means
