{
  "id": "file-drop-zone",
  "name": "File Drop Zone",
  "category": "forms",
  "tags": [
    "file",
    "upload",
    "dropzone",
    "input",
    "dashed"
  ],
  "description": "A dashed upload area that wraps a real file input, so click and drop both work.",
  "url": "https://copy-css.com/snippets/file-drop-zone",
  "markdown": "https://copy-css.com/snippets/file-drop-zone.md",
  "html": "<label class=\"dropzone\">\n  <input type=\"file\" multiple>\n  <svg viewBox=\"0 0 24 24\" width=\"28\" height=\"28\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 16V4m0 0-4 4m4-4 4 4\"/><path d=\"M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3\"/></svg>\n  <span><b>Click to upload</b> or drag files here</span>\n</label>",
  "css": ".dropzone {\n  position: relative;\n  display: grid;\n  justify-items: center;\n  gap: 8px;\n  width: 260px;\n  padding: 26px 16px;\n  border: 2px dashed #cbd5e1;\n  border-radius: 14px;\n  background: #f8fafc;\n  color: #64748b;\n  font: 14px/1.4 system-ui, sans-serif;\n  text-align: center;\n  cursor: pointer;\n  transition: border-color 0.15s ease, background 0.15s ease;\n}\n\n/* The input covers the whole zone so files can be dropped anywhere on it */\n.dropzone input {\n  position: absolute;\n  inset: 0;\n  opacity: 0;\n  cursor: pointer;\n}\n\n.dropzone b {\n  color: #7c3aed;\n}\n\n.dropzone:hover,\n.dropzone:has(:focus-visible) {\n  border-color: #a78bfa;\n  background: #f5f3ff;\n  color: #6d28d9;\n}",
  "features": [
    "transitions",
    "CSS Grid",
    "the :has() selector",
    "keyboard focus styles"
  ],
  "customProperties": []
}
