FloatLabel
Floating / in-field label wrapper
For where a stacked label costs too much height — a sign-in card, a search bar, a filter row. A long form defaults to Field: it has description, error and required, this has a label.
Basic
- The control inside takes the wrapper's id, so the label is associated without
for/id.foris there for a control that already has one. over(default) is CSS-only and floats on focus or value via:placeholder-shown, so the control needs a placeholder —placeholder=" "will do; it is hidden. The wrapper reserves the room above for the floated label.inkeeps the label inside the control, top-aligned, and never moves; no placeholder needed.
Usage
ts
import { BlessFloatLabel } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
label* | string | — | |
for | string | — | id of the control; by default the control inside takes the wrapper's id |
variant | "over" | "in" | "over" | over = floats up on focus/value; in = always inside, top-aligned (IFTA) |
Slots
| Name | Scope | Description |
|---|---|---|
default | — |