Floating Label Input
Server ComponentText field whose label floats above on focus or when filled.
Import
import { FloatingLabelInput } from "@cronus-ui/ui";
npx cronus-ui add floating-label-input
Examples
.cronus
The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.
default.cronus
app "audit-fixtures" {
port 5176
}
style {
preset aurora
theme dark
}
component FloatingLabelInputDefault layout:inline style:floating-label-input {
value:"ada@cronus.dev"
label "Email"
}
page "/audit/floating-label-input/default" type:custom {
use FloatingLabelInputDefault
}
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>`. |
value | string | — | Controlled value. |
defaultValue | string | — | Uncontrolled initial value. |
onChange | (event: ChangeEvent<HTMLInputElement>) => void | — | Called when the value changes. |
disabled | boolean | — | Disables pointer and keyboard interaction. |
name | string | — | Submitted name when used in a form. |
required | boolean | — | Marks the control as required. |
className | string | — | Additional class names merged onto the root. |