Input

● Stable · v0.1

Capture text or a number with the least possible typing burden and an honest, visible state at every moment. Capture is the hardest part of DayTwo in real life — Input is built to make it feel effortless and safe.

In context

9:41

Purpose

Input collects one value from the user — a name, an amount, a note. Its job is to make entry fast and reassuring for someone who finds typing a chore: a large field, a visible label, an obvious focus state, and errors that explain rather than scold.

Anatomy

  • Label — always present, always above the field. A placeholder is a hint, never a label.
  • Field — the tap area; at least 48dp tall, with a subtle grey border.
  • Prefix / suffix — an optional fixed affix inside the field, e.g. a Ks currency marker.
  • Helper or error text — quiet guidance, or a clear recovery message when something's wrong.

States

A field sits on a subtle grey hairline — a control needs a defined edge to read as tappable. When it's active, the stroke darkens to a clear neutral grey — a neutral cue, never brand colour, and no shadow. On error the border turns red and says what to do — colour alone isn't a message.

Code

import { Input } from '@daytwo/components'
<Input
label="Sale amount"
keyboardType="numeric"
value={amount}
onChangeText={setAmount}
helperText="Use the number pad — no need to type currency."
/>

When to use

  • Collecting a value that genuinely needs typing — a name, an amount, a short note.
  • Capturing money — set keyboardType="numeric" and add a Ks prefix so the user types digits only.

When NOT to use

  • For a choice among a few known options — use chips or a picker. Typing is the most expensive interaction we ask of the user.
  • For a yes/no setting — use a switch.
  • As the only path to capture — offer lower-effort routes too (a receipt photo, a repeat-last-sale shortcut).

The correct scenario

Logging a cash sale: a Customer name field and a numeric Sale amount field with a Ks prefix. The labels stay visible while typing, the number pad is one tap away, and the user never has to type the currency or guess what a field is for.

Anti-patterns

Do
A visible label above the field, a numeric keypad for amounts, and an error that says what to fix.
Don't
A placeholder used as the label (it vanishes on focus), a full keyboard for a number, and a field that just turns red with no message.
Minimise typing, always

Every field is friction. Before adding an Input, ask whether a tap, a chip, or a receipt photo could capture the same thing. The advice users want depends on data they won't fight to enter.

Edge cases

Long Burmese label
Label wraps above the field; the field height is unaffected
WhyBurmese runs ~1.3–1.7× longer — labels must not clip
Numeric capture
keyboardType="numeric" + Ks prefix
WhyFewer keystrokes, fewer wrong entries on money
Error
Red border and a plain-language message
WhyColour-blind and low-literacy users need the words
Disabled
Dimmed, non-editable (e.g. a value synced from a receipt)
WhyShows the value without implying it's editable
Offline
Typing works normally; the save handles the queue
WhyCapture should never feel blocked by connectivity

Tokens used

color.surface.primarycolor.background.secondarycolor.border.subtlecolor.border.defaultcolor.border.strongcolor.text.primarycolor.text.tertiarycolor.feedback.errorSolidradius.mdspacing.16touchTargets.min