DEV Community

Cover image for Tailwind CSS Drag and Drop File Upload UI
saim
saim

Posted on • Originally published at larainfo.com

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
view

Tailwind CSS Dropbox File upload UI.



<div class="max-w-xl">
    <label
        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="http://www.w3.org/2000/svg" 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" />
            </svg>
            <span class="font-medium text-gray-600">
                Drop files to Attach, or
                <span class="text-blue-600 underline">browse</span>
            </span>
        </span>
        <input type="file" name="file_upload" class="hidden">
    </label>
</div>


Enter fullscreen mode Exit fullscreen mode

tailwind css drag and drop file upload image

Top comments (2)

Collapse
 
lunadxp profile image
coronelius • Edited

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

Collapse
 
abhidadhaniya23 profile image
Abhi Dadhaniya

Thank you so much. It's helpful.