Text input

One line of text, with room at either end for a mark or an affix. The plainest field in the library, and the one the others are shaped like.

As it appears on your card.
<Input
  size="md"
  label="Last name"
  required
  info="We only use this on your invoices."
  leading={<UserIcon />}
  trailing={<SearchIcon size={20} />}
  hint="As it appears on your card."
/>

Slots

Four, and the pairing is deliberate. leading and trailing take a mark: an icon, a spinner, a button. prefix and suffix take text that is read as part of the value: a currency symbol, a protocol, a unit. They are separate props because the design spaces them differently. An affix sits 12px in from the edge with 14px to the value, because it belongs to the value rather than sitting beside it.

billing-form.tsx
import { Input } from 'yote-ui'

<Input label="Website" prefix="https://" placeholder="billia.io" />
<Input label="Amount" prefix="$" suffix="USD" />
<Input label="Search" leading={<SearchIcon />} />

Nothing is rendered for a slot you leave unset, so the field collapses to a plain box with no stray padding. The gap belongs to the slot, not to the field.

Sizes

Only sm is drawn in Figma. The other two follow the ramp the password field already set, so a form mixing fields lines up rather than each component inventing its own scale.

sizeRadiusPaddingNotes
sm8px8pxFigma 6:508. The only measured one.
md12px10pxThe default.
lg12px12px

Props

PropTypeDefaultNotes
leadingReactNode—A mark at the start of the field. 20px in the frame.
trailingReactNode—A mark at the end. Also where an inline selector goes.
prefixReactNode—Text at the start, inside the field.
suffixReactNode—Text at the end, inside the field.
requiredbooleanfalseRenders the asterisk and sets aria-required.
optionalbooleanfalseRenders the muted "(Optional)" note.
infostring—Info marker beside the label, with this as its tooltip.

Shared

PropTypeDefaultNotes
valuestring—Controlled value.
defaultValuestring—Initial value when uncontrolled.
onChange(value: string) => void—Receives the value, never the event.
labelReactNode—Rendered as a real <label> wired by htmlFor.
hintReactNode—Helper text under the field.
errorReactNode—Error text. Implies invalid unless invalid says otherwise.
invalidboolean—Forces the error styling on or off.
errorKeystring | number—Change it to replay the error animation.
disabledbooleanfalseGreys the field out.
readOnlybooleanfalseReads as filled, stays focusable.
size'sm' | 'md' | 'lg''md'Size scale, where the component defines one.
classNamesRecord<Part, string>—Per-part class names.