jbmui

UiInput

  • UI Bits

Illustrated outlined text field with a placeholder bar and a cursor you switch on or off.

Install

npx shadcn@latest add @jbm/ui-input

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

Also installs @jbm/tokens, @jbm/paper.

Usage

Field with the cursor showing
import { UiInput } from "@/jbm/ui/ui-input"<UiInput w={220} h={70} cursorOn />
Blink the cursor on a Remotion timeline
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. w and h set 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.

PropTypeDefaultDescription
wnumber220Width in stage pixels, including the 2px Paper edge.
hnumber70Height in stage pixels; sets the corner radius (22%), inner padding (28%), cursor height (50%), and placeholder thickness (12%, at least 6px).
cursorOnbooleantrueShows the cursor (opacity 1) when true, hides it (opacity 0) when false; the cursor keeps its space either way.
styleReact.CSSPropertiesnoneInline 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).