Component
Underline Input
Minimal underline style input fields with floating labels that animate on focus
- Component
- Tailwind
- MIT
Preview
Live component
9:41 100%
devsnips.dev/library/tailwind/components/input/underline/ fluid · no fixed width 100%
Install
Add to your project
npx devsnips add Tailwind/Components/Input/underline Tailwind/Components/Input/underline <!-- Underline Input - Default -->
<div class="relative">
<input type="text" placeholder=" " class="peer w-full px-0 py-3 bg-transparent border-0 border-b-2 border-gray-300 rounded-none focus:outline-none focus:border-blue-600 placeholder-transparent peer-focus:placeholder-transparent" />
<label class="absolute left-0 -top-3.5 text-sm text-gray-600 transition-all pointer-events-none peer-placeholder-shown:top-3 peer-placeholder-shown:text-base peer-focus:-top-3.5 peer-focus:text-sm">Email address</label>
</div>
<!-- Underline Input - With Value -->
<div class="relative mt-6">
<input type="text" value="john.doe@example.com" class="peer w-full px-0 py-3 bg-transparent border-0 border-b-2 border-gray-300 rounded-none focus:outline-none focus:border-blue-600 placeholder-transparent peer-focus:placeholder-transparent" />
<label class="absolute left-0 -top-3.5 text-sm text-gray-600 transition-all pointer-events-none peer-placeholder-shown:top-3 peer-placeholder-shown:text-base peer-focus:-top-3.5 peer-focus:text-sm">Email address</label>
</div>
<!-- Underline Input - Dark Variant -->
<div class="relative mt-6 bg-gray-900 p-4 rounded-lg">
<input type="text" placeholder=" " class="peer w-full px-0 py-3 bg-transparent border-0 border-b-2 border-gray-500 text-white rounded-none focus:outline-none focus:border-blue-400 placeholder-transparent peer-focus:placeholder-transparent" />
<label class="absolute left-0 -top-3.5 text-sm text-gray-400 transition-all pointer-events-none peer-placeholder-shown:top-3 peer-placeholder-shown:text-base peer-focus:-top-3.5 peer-focus:text-sm">Dark mode input</label>
</div> # Underline Input
Underline-style text input.
## Usage
```bash
npx devsnips add Tailwind/Components/Input/underline
```
Copy from `code.html`.
## File Structure
`code.html` · `preview.html` · `metadata.json` · `README.md` 17 lines UTF-8 · LF · Spaces: 2
Continue browsing