Floating Input

A text field whose label rests inside and floats up when you focus or type.

no dependenciesMIT · free

Please enter a complete email address.

Installation

npx shadcn@latest add https://ombakui.com/r/floating-input.json

Usage

import { FloatingInput } from "@/components/floating-input";

<FloatingInput label="Email" type="email" name="email" required />
<FloatingInput label="Email" error hint="Please enter a complete email address." />

Props

PropTypeDefaultDescription
label*string–The label. It sits inside the field and floats up when focused or filled.
hintstring–Helper or error text under the field.
errorbooleanfalseShow the hint as an error and mark the field invalid.
classNamestring–