DEV Community

Cover image for Tailwind CSS Drag and Drop File Upload UI
Saim Ansari
Saim Ansari

Posted on • Originally published at

Tailwind CSS Drag and Drop File Upload UI

in this section we will create tailwind css drag and drop box ui.

Tool Use

Tailwind CSS 2.x or 3.x

Heroicons Icons

Tailwind CSS Dropbox File upload UI.

<div class="max-w-xl">
        class="flex justify-center w-full h-32 px-4 transition bg-white border-2 border-gray-300 border-dashed rounded-md appearance-none cursor-pointer hover:border-gray-400 focus:outline-none">
        <span class="flex items-center space-x-2">
            <svg xmlns="" class="w-6 h-6 text-gray-600" fill="none" viewBox="0 0 24 24"
                stroke="currentColor" stroke-width="2">
                <path stroke-linecap="round" stroke-linejoin="round"
                    d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" />
            <span class="font-medium text-gray-600">
                Drop files to Attach, or
                <span class="text-blue-600 underline">browse</span>
        <input type="file" name="file_upload" class="hidden">
Enter fullscreen mode Exit fullscreen mode

tailwind css drag and drop file upload image

Top comments (2)

lunadxp profile image
coronelius • Edited

I used it for myself and in a how-to tutorial for Wire

abhidadhaniya23 profile image
Abhi Dadhaniya

Thank you so much. It's helpful.