UiInput
Illustrated outlined text field with a placeholder bar and a cursor you switch on or off.
Install
npx shadcn@latest add @jbm/ui-inputNeeds the @jbm entry in components.json; see Install once.
Also installs @jbm/tokens, @jbm/paper.
Usage
import { UiInput } from "@/jbm/ui/ui-input"<UiInput w={220} h={70} cursorOn />import { UiInput } from "@/jbm/ui/ui-input"import { useSec } from "@/jbm/motion/hooks" // install @jbm/motion-hooks separately// Render inside a Remotion <Composition> or <Player>: hooks run in the component body.export function BlinkingInput() { const sec = useSec() return <UiInput w={420} h={120} cursorOn={Math.floor(sec * 2) % 2 === 0} />}Props
- Stage px
- Declared at the documented defaults
- Landscape
220 by 70- Vertical
220 by 70- Basis
Fixed w × h box (border-box) at the defaults 220 × 70.
wandhset it directly; the Paper shadow extends below the box.
Cream paper field with an ink outline, a 3px ink cursor (half the height), and a line-colour placeholder bar at 45% of the width. It has no internal timer and no real text entry: blink the cursor by toggling cursorOn from a timeline.
| Prop | Type | Default | Description |
|---|---|---|---|
w | number | 220 | Width in stage pixels, including the 2px Paper edge. |
h | number | 70 | Height in stage pixels; sets the corner radius (22%), inner padding (28%), cursor height (50%), and placeholder thickness (12%, at least 6px). |
cursorOn | boolean | true | Shows the cursor (opacity 1) when true, hides it (opacity 0) when false; the cursor keeps its space either way. |
style | React.CSSProperties | none | Inline styles merged over the field's flex row; use for positioning or opacity. |
QA checks
- Toggle cursorOn: the cursor appears and disappears without shifting the placeholder bar.
- Check small and large h: padding, radius, and cursor scale with h while the placeholder floors at 6px thick.
- At narrow w with a tall h, confirm the placeholder bar and padding still fit inside the field (it does not clip its children).