Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

InputText

InputText is an extension to standard input element with icons and theming.

Used as the display name across your workspace
preview

Usage#

import { InputText } from '@primereact/ui/inputtext';
<InputText />

Examples#

Basic#

A plain text input with support for controlled and uncontrolled modes.

basic-demo

Clear Icon#

Combine InputText with IconField to display a clear icon that resets the value when clicked.

clear-icon-demo

Sizes#

InputText provides small and large sizes as alternatives to the base by setting the size property.

sizes-demo

Filled#

Specify the variant property as filled to display the component with a higher visual emphasis than the default outlined style.

filled-demo

Invalid#

Invalid state is displayed using the invalid prop to indicate a failed validation. This style is useful when integrating with form validation libraries.

invalid-demo

Disabled#

When disabled is present, the element cannot be edited and focused.

disabled-demo

API#

Sub-Components#

See Primitive API for InputText component documentation.

Hooks#

See Headless API for useInputText hook documentation.

Accessibility#

See InputText Primitive for WAI-ARIA compliance details and keyboard support.