Skip to content

File Card

A copy-paste drag & drop component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Drag & DropHTMLCSSany framework
design.fig
68%

Copy into your project

HTML
<!-- File Card — show as items upload (set --p target via JS) -->
<div class="nuda-file" style="--p: 68%">
  <div class="nuda-file__icon">
    <svg viewBox="0 0 24 24" fill="none" stroke="currentColor"
         stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
      <path d="M14 3 L14 8 L19 8" />
      <path d="M14 3 L7 3 A 2 2 0 0 0 5 5 L5 19 A 2 2 0 0 0 7 21 L17 21 A 2 2 0 0 0 19 19 L19 8 Z" />
    </svg>
  </div>
  <div class="nuda-file__info">
    <span class="nuda-file__name">design.fig</span>
    <div class="nuda-file__bar"><span></span></div>
  </div>
  <span class="nuda-file__pct">68%</span>
</div>
CSS
/* File Card
   Compact upload row: icon, file name, progress bar, percentage.
   Customize: --p (current %), --fc-accent, --fc-bg */

.nuda-file {
  --p: 0%;
  --fc-accent: #e4ff54;
  --fc-bg: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
  max-width: 320px;
  background: var(--fc-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  animation: nuda-fc-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.nuda-file__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(228, 255, 84, 0.1);
  color: var(--fc-accent);
  border-radius: 6px;
}

.nuda-file__icon svg { width: 16px; height: 16px; }

.nuda-file__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nuda-file__name {
  font: 600 0.75rem ui-sans-serif, system-ui, sans-serif;
  color: #fafafa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nuda-file__bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.nuda-file__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--fc-accent), rgba(228, 255, 84, 0.6));
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(228, 255, 84, 0.4);
  animation: nuda-fc-prog 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.nuda-file__pct {
  font: 700 0.7rem ui-sans-serif, system-ui, sans-serif;
  color: #a1a1aa;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

@keyframes nuda-fc-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes nuda-fc-prog { to { width: var(--p); } }

@media (prefers-reduced-motion: reduce) {
  .nuda-file,
  .nuda-file__bar span { animation: none; }
  .nuda-file__bar span { width: var(--p); }
}

How to use File Card

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More drag & drop components

← Browse all NudaUI components