Skip to content
Forms

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">

PropTypeDefaultDescription
label*
ReactNodeThe label text. Sits in the placeholder position, then floats up when the field is focused or filled.
helperText
ReactNodeOptional caption rendered under the field and linked to the input via `aria-describedby`. Turns into an error message when `invalid`.
invalid
booleanfalseMarks the field invalid — drives the error border/ring, error label color, and an announced (`role="alert"`) helper.
startAdornment
ReactNodeDecorative content (usually an icon) pinned to the left; the label and input inset to make room.
endAdornment
ReactNodeContent (icon or button) pinned to the right; the input insets to make room.
labelClassName
stringExtra classes for the floating `<label>`.