ComponentsFormInput

Input

Inputs let people enter or edit text. Clear labels, purposeful guidance, and timely validation make the expected value easy to understand.

3 variants3 sizesValidationPassword disclosureTextareaCharacter count

Overview

Use an input to collect a short text value that people can understand and complete without a specialized selection control.

Labeled input

Live preview

A visible label identifies the value; helper text explains requirements that are not obvious from the label.

Use the address connected to your organization.

ProfileForm.tsx
tsx
import { Input } from 'omverse-ui'
 
<Input
label="Work email"
type="email"
placeholder="name@company.com"
helperText="Use the address connected to your organization."
/>
A placeholder is an example or formatting hint—not a replacement for a visible label. Placeholders disappear after entry and are not a reliable field name.

Anatomy

The field combines a persistent label, editable control, optional affordances, and supporting feedback linked to the control.

https://
.omverse.app

You can change this later in workspace settings.

123456
  1. 1
    LabelRequired

    Names the value in concise, familiar language.

  2. 2
    ContainerRequired

    Communicates boundary, focus, validation, and availability.

  3. 3
    Prefix or leading icon

    Provides non-editable context such as protocol, currency, or data type.

  4. 4
    Editable valueRequired

    The entered text and caret inside the native control.

  5. 5
    Suffix or action

    Shows units or a clear, copy, or password disclosure action.

  6. 6
    Supporting text

    Provides guidance, validation feedback, or a character count.

When to use

Use an input when people need to enter a value that cannot be selected efficiently from a known set.

Recommended

  • Collect unique or open-ended text

    Names, email addresses, URLs, identifiers, search terms, and short descriptions.

  • Allow direct editing

    Use when people must review and modify a value character by character.

  • Apply native input capabilities

    Choose an appropriate type and inputMode for email, phone, URL, numeric, and password values.

When not to use

Prefer a specialized control when choices, formatting, or interaction constraints are known in advance.

Avoid

  • Do not use for a small known set

    Use Select, Radio, Checkbox, or Switch so available choices remain visible and valid.

  • Do not use for dates or ranges

    Use DatePicker or Slider when structured selection prevents formatting errors.

  • Do not imitate rich text or code editing

    Use a purpose-built editor when syntax, formatting, mentions, or large documents are required.

Variants

Variants change field presentation without changing semantics. Keep one treatment consistent within a form.

Container treatments

Live preview

Outlined is the general default; filled supports denser surfaces; floating preserves a compact label inside the field.

ProjectForm.tsx
tsx
<Input variant="outlined" label="Project name" />
<Input variant="filled" label="Project name" />
<Input variant="floating" label="Project name" />

Outlined

Default choice for forms on plain or mixed surfaces.

Filled

Useful in compact forms where a tonal surface groups editable controls.

Floating

Keeps a compact label visible while people enter or review a value.

Sizes

Use one size within a form. Medium provides the standard 44px control height.

States

Field states explain whether a value can be edited, whether validation is running, and how people can correct a problem.

Validation and availability

Live preview

Messages explain the state in text so color and icons are never the only signal.

Supporting guidance

Checking availability…

Use at least three characters.

Workspace name is available.

StateTriggerVisual responseInteraction
DefaultField is availableNeutral border and supporting textAccepts text and native input behavior
FocusKeyboard, pointer, or assistive inputPrimary border and visible focus treatmentCaret and editing controls become active
PopulatedA value is presentValue replaces placeholder; floating label remains raisedValue can be edited or cleared
LoadingAsync validation is runningProgress indicator in the trailing slotField remains editable unless the workflow prevents it
ErrorValidation failsError border, icon, and actionable messageFocus remains in the field for correction
SuccessValidation succeedsSuccess border, icon, and confirmationEditing remains available
Read onlyValue can be viewed but not editedRead-only surface treatmentValue remains focusable and copyable
DisabledField is unavailableReduced emphasisRemoved from editing and normal focus order

Behavior

Input behavior follows the native control while adding predictable labeling, validation, and optional field actions.

Editing

Use controlled or uncontrolled values. Do not transform text while someone is actively typing unless the format requires it.

Validation

Validate after a meaningful interaction such as blur or submit. Avoid showing an error before people can respond.

Async checks

Debounce remote validation, show progress, and ignore stale responses when the value changes.

Form layout

Align fields in a clear reading order and keep labels, requirements, and message placement consistent.

Accessibility

Input connects its visible label and supporting message to a native form control and exposes validation state programmatically.

KeyAction
TabMoves focus to the field and then to any trailing field action.
ShiftTabMoves focus to the previous interactive control.
EscPreserves native browser behavior; clear only through the visible clear action.
  • Provide a visible label for every editable field.
  • Use the correct native type and autocomplete value.
  • Link helper and validation text with aria-describedby.
  • Expose invalid values with aria-invalid.
  • Keep error messages specific and actionable.
  • Do not disable paste in password or verification fields.
  • Maintain a visible focus indication in every variant.
  • Ensure clear, copy, and password actions have accessible names.

Content guidelines

Labels and messages should make the expected value and correction path immediately understandable.

Use noun labels

Name the information being requested rather than writing a question or instruction.

ExampleWork email

Show realistic examples

Use placeholder text only for format or domain examples, never essential instructions.

Examplename@company.com

Explain constraints early

Put stable requirements in helper text instead of waiting for an avoidable error.

ExampleUse 8–64 characters.

Write actionable errors

State what is wrong and how to fix it without blaming the person.

ExampleEnter a valid work email address.

Examples

Compose field affordances only when they reduce ambiguity or support a specific workflow.

Validation

Live preview

Pair programmatic validation state with clear, adjacent feedback.

Enter a complete email address, such as alex@company.com.

Structured values

Live preview

Prefixes and suffixes clarify which part of the displayed value is editable.

https://
$
USD

Describe the goal and expected outcome.

0 / 240

AccountForm.tsx
tsx
<Input
label="Work email"
value={email}
onChange={(event) => setEmail(event.target.value)}
error={submitted && !isValidEmail(email)}
errorText="Enter a valid work email address."
success={isValidEmail(email)}
successText="Email address verified."
/>
WorkspaceForm.tsx
tsx
<Input label="Website" prefix="https://" placeholder="example.com" />
<Input label="Budget" prefix="$" suffix="USD" inputMode="decimal" />
<Input label="Password" type="password" passwordToggle />
<Input label="API key" value={apiKey} readOnly copyable />
<Input label="Summary" textarea rows={4} maxLength={240} showCount />

Props / API

Input extends native input attributes except size and prefix, which use the component-specific API.

Props

PropTypeDefaultDescription
variant'outlined' | 'filled' | 'floating''outlined'Sets the container and label treatment.
size'sm' | 'md' | 'lg''md'Controls field height, spacing, and type size.
labelstringundefinedVisible label associated with the field.
requiredbooleanfalseAdds the required indicator and aria-required.
optionalbooleanfalseAdds an optional indicator beside the label.
helperTextstringundefinedPersistent guidance associated through aria-describedby.
errorbooleanfalseApplies invalid styling and aria-invalid.
errorTextstringundefinedActionable validation message that replaces helper text.
successbooleanfalseApplies the successful validation state.
successTextstringundefinedConfirmation text that replaces helper text.
loadingbooleanfalseShows async progress and applies aria-busy.
leadingIconIconNameundefinedDecorative icon before the editable value.
trailingIconIconNameundefinedDecorative icon after the editable value.
clearablebooleanfalseShows a clear action when the field has a value.
passwordTogglebooleanfalseAdds a password visibility control.
prefixReactNodeundefinedNon-editable content before the value, such as a currency symbol.
suffixReactNodeundefinedNon-editable content after the value, such as a unit.
maxLengthnumberundefinedLimits the maximum number of entered characters.
showCountbooleanfalseShows the current count when maxLength is provided.
textareabooleanfalseRenders a multiline text area.
rowsnumber3Sets the initial visible rows in textarea mode.
copyablebooleanfalseAdds a copy action, usually for read-only values.
wrapperClassNamestringundefinedAdds classes to the outer field wrapper.