Docs / Components

SenseIconFieldComponent

Flex layout wrapper from @artificialsenselabs/ui that aligns a projected icon beside a form control. Dogfoods sense-icon and pairs with sense-input or native inputs.

Live demo: run nx serve showcase and open /components/icon-field (port 4202).

Overview

Category: Form / layout. Selector: sense-icon-field. Import: import { SenseIconFieldComponent } from '@artificialsenselabs/ui';

<sense-icon-field iconPosition="left">
  <sense-icon name="search" />
  <sense-input ariaLabel="Search" placeholder="Filter…" />
</sense-icon-field>

Projection contract

Project an icon and a control as direct children. Typical pairings:

  • sense-icon (decorative) + sense-input
  • sense-icon + native input with an associated label

The control must expose its own accessible name — the wrapper does not add labels.

Inputs

InputTypeDefaultDescription
iconPosition'left' | 'right''left'Places the projected icon before or after the control.
styleClassstring | nullnullExtra class names merged onto the host element.

Accessibility

  • Keep icons decorative inside labelled controls — omit per-icon ariaLabel.
  • Ensure the control has a visible label or ariaLabel / aria-labelledby.
  • Icon position is visual only; reading order follows DOM projection order.