formsRauno
Input Decorations Positioning
MUST
MUST: Absolutely position input prefix/suffix icons on top of the input and pad the input around them — do not place them as flex siblings. Clicking a decoration must focus the input.
Input prefix and suffix decorations should be absolutely positioned inside the input with padding, not next to it
<div className="relative">
<SearchIcon className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2" />
<input className="pl-9" />
</div>Bad
Good
Why it matters
When decorative elements like search icons or currency symbols are placed next to an input in a flex layout, clicking them doesn't focus the input. Position them absolutely inside the input container so the entire area is clickable and the input receives focus.
References