Floating Label Input
InputWeb + NativeMITLabel sits inside the field at rest, floats up + shrinks on focus or when filled.
bun add @otfdashkit/ui
Preview
Floating Label InputInput
Loading Storybook preview…
Code
@otfdashkit/uiimport { FloatingLabelInput } from '@otfdashkit/ui'
export function Example() {
const args = {
label: 'Email',
}
return (
<div className="w-[360px]">
<FloatingLabelInput {...args} />
</div>
)
}
Free with the SDK. This component ships in @otfdashkit/ui under the MIT license.
Props
Props declared in the FloatingLabelInput source. Inherited HTML attributes are not listed.
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | string | Label that floats up when focused or filled. | |
| error | string | Inline error text shown below the input. | |
| hint | string | Helper text shown below the input when there's no error. | |
| wrapperClassName | string | Wrap the field + label + helper text in this className for layout. |