Flowbite Svelte: v0.46.14
Svelte: v5.0.0-next.179
SvelteKit: v2.5.18
Vite: v5.3.3

Floating Label

The floating label style was first pioneered by Google in its infamous Material UI design system and it’s basically a label tag which floats just above the input field when it is being focused or already has content inside. On this page you will find a three different input field styles including a standard, outlined, and filled style including validation styles and sizes coded with Tailwind CSS and supported for dark mode.

Floating label examples

Get started with the following three styles for the floating label component and use the label tag as a visual placeholder using the peer-placeholder-shown and peer-focus utility classes from Tailwind CSS.

Disabled state

Apply the disabled attribute to the input fields to disallow the user from changing the content.

Validation

Use the following examples of input validation for the success and error messages by applying the validation text below the input field and using the green or red color classes from Tailwind CSS.

Well done! Some success message.

Well done! Some success message.

Well done! Some success message.

Oh, snapp! Some error message.

Oh, snapp! Some error message.

Oh, snapp! Some error message.

Sizes

Use the small and default sizes of the floating label input fields from the following example.

Helper text

Add a helper text in addition to the label if you want to show more information below the input field.

Remember, contributions to this topic should follow our Community Guidelines .