tailwind css input file ui example

in this section we will create tailwind input file upload ui, input file form style, input file ui, input file with image example with Tailwind CSS 3.


Example 1

Tailwind CSS 3 simple input file ui.

<form>
  <label class="block">
    <span class="sr-only">Choose profile photo</span>
    <input type="file"
      class="block w-full text-sm text-gray-500 file:py-2 file:px-6 file:rounded file:border-1 file:border-gray-400" />
  </label>
</form>


Input file form with shadow.

<form> 
  <label class="block shadow">
    <span class="sr-only">Choose File</span>
    <input type="file" class="block w-full text-sm text-gray-500 file:py-2 file:px-6 file:rounded file:border-1 file:border-gray-400"/>
  </label>
</form>
tailwind css input file style

tailwind css input file style


Example 2

Input file form rounded circle style.

<form> 
    <label class="block">
      <span class="sr-only">Choose File</span>
      <input type="file" class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"/>
    </label>
  </form> 
tailwind circle input file

tailwind circle input file

Example 3

Tailwind CSS with input file with image (profile upload).

<form class="flex items-center space-x-6">
  <div class="shrink-0">
    <img class="object-cover w-16 h-16 rounded-full"
      src="https://cdn.pixabay.com/photo/2016/04/22/04/57/graduation-1345143__340.png" alt="profile photo" />
  </div>
  <label class="block">
    <span class="sr-only">Choose File</span>
    <input type="file"
      class="block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-full file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100" />
  </label>
</form>
tailwind profile file input

tailwind profile file input

Read Also

Tailwind CSS 3 FAQ Accordion UI Example

Tailwind CSS 3 Alert Message Example

Tailwind CSS 3 Avatars Example

Tailwind CSS 3 Badges Example

Tailwind CSS 3 Breadcrumb Example

Tailwind CSS v3 Button Examples

Tailwind CSS Gradient Button Example

Tailwind CSS 3D Button Example

Tailwind CSS Loading Button Example

Tailwind CSS v3 Cards Examples

Tailwind CSS Checkbox Form Examples

Tailwind CSS Dropdowns (Menu) on Hover Example

Tailwind CSS Multiselect Dropdown Example

How to use dark mode toggle switch in Tailwind CSS 3

How to use @apply directive in Tailwind CSS

Tailwind CSS sticky header & fixed navbar example

Tailwind CSS Navbar UI Example

Tailwind CSS 3 Login Page UI Example

Tailwind CSS Login Modal Example

Tailwind CSS Search Examples

Tailwind CSS 3 Overlay Image Example

Tailwind CSS Thank You Page Example

Tailwind CSS Timeline UI Example

Tailwind CSS Responsive Footer Section Example

Tailwind CSS Background Image Header Example