ArtificialSenseDocs

Docs / Components

SenseFloatLabelComponent

Float-label wrapper from @artificialsenselabs/ui that pairs a projected label with a form control and applies over, in, or on layout variants.

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

Overview

Category: Form. Selector: sense-float-label. Import: import { SenseFloatLabelComponent } from '@artificialsenselabs/ui';

<sense-float-label variant="in">
  <label>Email</label>
  <input type="email" />
</sense-float-label>

Projection contract

Project exactly two direct children in this order:

  1. A native <label>
  2. A control: input, textarea, select, or a custom host such as sense-input

The wrapper auto-wires for/id, sets a blank placeholder on text controls when needed for :placeholder-shown styling, and uses aria-labelledby for non-native hosts.

Inputs

InputTypeDefaultDescription
variant'over' | 'in' | 'on''over'Label position treatment โ€” matches PrimeNG FloatLabel variants.

Accessibility

  • Always pair a visible <label> with the control โ€” the wrapper does not invent label text.
  • Native controls receive programmatic for/id association when missing.
  • Custom hosts fall back to aria-labelledby referencing the label id.
  • Blank placeholder (" ") is added only when empty so float styling can use :placeholder-shown.