Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

IconField

IconField wraps an input and an icon.

⌘+K
US
preview

Usage#

import { IconField } from '@primereact/ui/iconfield';
<IconField.Root>
    <IconField.Inset />
</IconField.Root>

Examples#

Basic#

An input field with an embedded leading or trailing icon.

basic-demo

Float Label#

FloatLabel visually integrates a label with its form element. Visit FloatLabel documentation for more information.

float-label-demo

Ifta Label#

IftaLabel is used to create infield top aligned labels. Visit IftaLabel documentation for more information.

ifta-label-demo

Clickable#

Icons inside IconField.Inset can be interactive with event handlers like onClick.

clickable-demo

Sizes#

IconField is compatible with the size setting of the input field.

sizes-demo

Accessibility#

Screen Reader#

IconField.Root and IconField.Inset do not require any roles and attributes.

Keyboard Support#

Component does not include any interactive elements.