Floating Label Input
Text field whose label floats above on focus or when filled.
Import
tsx
import { FloatingLabelInput } from "@cooud-ui/ui";
bash
npx cooud-ui add floating-label-input
Examples
API Reference
Generated from the component's exported types.
FloatingLabelInputProps
Extends Omit<InputHTMLAttributes<HTMLInputElement>, "placeholder">
| Prop | Type | Default | Description |
|---|---|---|---|
label* | ReactNode | — | The label text. Sits in the placeholder position, then floats up when the field is focused or filled. |
helperText | ReactNode | — | Optional caption rendered under the field and linked to the input via `aria-describedby`. Turns into an error message when `invalid`. |
invalid | boolean | false | Marks the field invalid — drives the error border/ring, error label color, and an announced (`role="alert"`) helper. |
startAdornment | ReactNode | — | Decorative content (usually an icon) pinned to the left; the label and input inset to make room. |
endAdornment | ReactNode | — | Content (icon or button) pinned to the right; the input insets to make room. |
labelClassName | string | — | Extra classes for the floating `<label>`. |