Loading preview
Number Stepper
InputsA number field with minus and plus buttons, clamped to a range.
A text field whose label sits inside and floats above on focus or when filled.
npx shadcn@latest add @venusui/floating-label-inputRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/floating-label-input.tsxThe code behind the preview above.
floating-label-input-demo.tsx
import { FloatingLabelInput } from "@/components/ui/floating-label-input"
export default function FloatingLabelInputDemo() {
return (
<form className="w-full max-w-sm space-y-3">
<FloatingLabelInput label="Email address" type="email" autoComplete="email" />
<FloatingLabelInput label="Company" autoComplete="organization" />
</form>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | — | Visible label. Required. |
| className | string | — | Classes for the wrapper. |
All <input> props except placeholder, which the floating effect uses internally.
cn helper at @/lib/utils. CSS only; works in Server Components.aria-invalid; the border turns red. Link an error message with aria-describedby.id to connect it to your own error text; otherwise an id is generated.<label> linked to the input, so it is announced and clicking it focuses the field.placeholder. The component relies on an empty placeholder to know when the field is empty.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A number field with minus and plus buttons, clamped to a range.
One-time code entry in separate boxes with paste, autofill and keyboard navigation.
A lock-screen passcode keypad that shakes on a wrong code and unlocks on the right one.