Components / Forms

Input

A complete field contract that keeps labels, guidance, validation, and adornments connected to a native input.
Available in @kape/react

A field, not just a box

Labels and supporting messages remain part of the component's observable contract.

Shown in navigation and shared links.
We will send one project update.

Installation and usage

Input accepts native input attributes, so uncontrolled fields and controlled React state both work.

Input usage
import { Input } from "@kape/react";
import "@kape/react/styles.css";

<Input
  label="Email address"
  description="Used for project updates."
  name="email"
  type="email"
/>

Props

PropTypeRequiredPurpose
labelReactNodeYesAccessible label for the native input
descriptionReactNodeNoPersistent guidance linked with aria-describedby
errorReactNodeNoLive validation feedback and invalid state
prefix / suffixReactNodeNoDecorative context around the editable value
sizesm | md | lgNoControl height and density
hideLabelbooleanNoVisually hides, but preserves, the label

Accessibility

  • A label is required and linked to the generated or consumer-provided ID.
  • Description and error IDs merge with consumer aria-describedby.
  • Errors set aria-invalid and use a live alert.
  • Prefix and suffix content is decorative; include meaningful units in the label.

Keyboard

Tab
Moves focus to the native input.
Platform keys
Editing, selection, and undo remain native.

Composition and limitations

Input deliberately owns a single native input. It does not provide masking, token entry, or combobox behavior. For currency and measurement fields, put the unit in the visible label even when a decorative suffix is present.