{
  "id": "styled-file-input",
  "name": "Styled File Input",
  "category": "forms",
  "tags": [
    "file input",
    "upload",
    "file-selector-button",
    "attachment",
    "browse",
    "form"
  ],
  "description": "A native file input restyled with ::file-selector-button, keeping the browser's own file name display.",
  "url": "https://copy-css.com/snippets/styled-file-input",
  "markdown": "https://copy-css.com/snippets/styled-file-input.md",
  "html": "<label class=\"file-pick\">\n  <span>Attach a file</span>\n  <input type=\"file\" name=\"attachment\" accept=\".pdf,.png,.jpg\">\n  <small>PDF, PNG or JPG, up to 10 MB</small>\n</label>",
  "css": ".file-pick {\n  display: grid;\n  gap: 6px;\n  width: 100%;\n  max-width: 280px;\n  color: #0f172a;\n  font: 600 13px system-ui, sans-serif;\n}\n\n.file-pick input {\n  min-width: 0;\n  padding: 6px;\n  border: 1.5px dashed #cbd5e1;\n  border-radius: 10px;\n  background: #fff;\n  color: #64748b;\n  font: 13px system-ui, sans-serif;\n  cursor: pointer;\n}\n\n.file-pick input::file-selector-button {\n  margin-right: 10px;\n  padding: 7px 12px;\n  border: 0;\n  border-radius: 7px;\n  background: #0f172a;\n  color: #fff;\n  font: 600 13px system-ui, sans-serif;\n  cursor: pointer;\n  transition: background 0.2s ease;\n}\n\n.file-pick input:hover::file-selector-button {\n  background: #334155;\n}\n\n.file-pick input:focus-visible {\n  border-color: #0f172a;\n  outline: 2px solid #0f172a;\n  outline-offset: 2px;\n}\n\n.file-pick small {\n  color: #64748b;\n  font-size: 12px;\n  font-weight: 400;\n}",
  "features": [
    "transitions",
    "CSS Grid",
    "keyboard focus styles"
  ],
  "customProperties": []
}
