Floating Label Input

Overview

An input whose label floats above the field when focused or filled.

This form component is intended for interfaces that need an input whose label floats above the field when focused or filled, authentication flows, and settings forms. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
shadcn/ui

No additional package dependency is declared for this component.

@spectrumui/floating-label-input-demo

Installation

Login to view commandCreate a free account to access the install command

Usage

Customize

You have fully control of the FloatingLabel and the FloatingInput

@spectrumui/floating-label-customize

Form

@spectrumui/floating-label-form

Props

PropTypeRequiredDescription
labelstringNoValue accepted by the label property in the exported source type.

Use cases

  • interfaces that need an input whose label floats above the field when focused or filled
  • authentication flows
  • settings forms

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • shadcn/ui dependencies: local UI primitives
  • Spectrum UI registry dependencies: @spectrumui/floating-label-input

Accessibility

  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.

Topic guides

See how this component fits into broader interface patterns, implementation decisions, and working examples.

Floating Label Input FAQ

Is Floating Label Input free to use in commercial projects?

Yes. The public Floating Label Input source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Floating Label Input?

Run npx shadcn@latest add @spectrumui/floating-label-input-demo or npx shadcn@latest add @spectrumui/floating-label-customize or npx shadcn@latest add @spectrumui/floating-label-form or npx shadcn@latest add label input. The page also exposes the source for manual installation.

Does Floating Label Input require Motion?

No Motion dependency was detected in the documented source or registry entry for Floating Label Input.

Does Floating Label Input use shadcn/ui or Radix UI?

Floating Label Input uses local shadcn/ui primitives.

Can I use Floating Label Input in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Floating Label Input?

No component-specific accessibility mechanism was detected automatically. Test keyboard operation, focus, labels, contrast, and screen-reader output before shipping.