← All components

Component

Input

Labelled text field with hint, error and affix-icon support.

Input.jsx Input.d.ts Input.prompt.md Open raw preview HTML

Live demo

Rendered with the actual component source, not a re-implementation.

We'll only use this to confirm your order.
Enter a number between 1 and 12.

Usage

import { Input } from "./Input.jsx";

<Input label="Full name" placeholder="Ada Okafor" required />
<Input label="Email" type="email" hint="We'll only use this to confirm your order." />

Props

Input props — see the source .d.ts for the complete type.
PropTypeDefaultDescription
labelReactNodeField label rendered above the control.
hintReactNodeHelper text shown below when there is no error.
errorReactNodeError message; sets invalid styling and replaces the hint.
requiredbooleanfalseAppend a rust asterisk to the label.
iconLeftReactNodeIcon node inside the field, leading edge.
iconRightReactNodeIcon node inside the field, trailing edge.