Component

Underline Input

Minimal underline style input fields with floating labels that animate on focus

  • Component
  • Tailwind
  • MIT

Preview

Live component

Interactive preview
Open preview
9:41 100%
devsnips.site/library/tailwind/components/input/underline/
fluid · no fixed width 100%
No dependencies Production-ready

Install

Add to your project

terminal
npx devsnips add Tailwind/Components/Input/underline
registry path: Tailwind/Components/Input/underline

Source

Implementation

code.html
<!-- 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="[email protected]" 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>
17 lines UTF-8 · LF · Spaces: 2
DevSnips AI ready Claude · Cursor · Windsurf

Agent skill & Model Context Protocol

Pass this component straight into your AI workflow. DevSnips exposes each resource as a structured, addressable registry entry, so your agent installs the real files instead of approximating them.

devsnips://components/input/underline
Prompt instruction
I want to use this DevSnips resource in production:

Page:
https://devsnips.site/library/tailwind/components/input/underline/

Install: npx devsnips add
Tailwind/Components/Input/underline

This is the Underline Input — Minimal underline style input fields with floating labels that animate on focus

Use this DevSnips resource as the starting point for my project.
Adapt it to my project's stack and conventions, fix any issues,
and make it production-ready while preserving its intended design
and behavior.

Paste into ChatGPT, Claude or your agent — it already carries the page URL and the exact install path.

Resource URI
devsnips://components/input/underline