{
  "id": "outlined-floating-label",
  "name": "Outlined Floating Label",
  "category": "forms",
  "tags": [
    "floating label",
    "outlined",
    "material",
    "notch",
    "input",
    "placeholder-shown"
  ],
  "description": "A Material-style outlined input whose label shrinks into a notch on the top border when focused or filled.",
  "url": "https://copy-css.com/snippets/outlined-floating-label",
  "markdown": "https://copy-css.com/snippets/outlined-floating-label.md",
  "html": "<label class=\"outlined\">\n  <input type=\"text\" name=\"name\" autocomplete=\"name\" placeholder=\" \">\n  <span>Full name</span>\n</label>",
  "css": ".outlined {\n  --accent: #0d9488;\n  position: relative;\n  display: block;\n  width: 240px;\n  font-family: system-ui, sans-serif;\n}\n\n.outlined input {\n  box-sizing: border-box;\n  width: 100%;\n  padding: 14px 14px;\n  border: 1.5px solid #a1a1aa;\n  border-radius: 8px;\n  background: #fff;\n  color: #18181b;\n  font: 16px system-ui, sans-serif;\n  outline: none;\n  transition: border-color 0.2s ease;\n}\n\n.outlined span {\n  position: absolute;\n  top: 50%;\n  left: 10px;\n  padding: 0 4px;\n  background: #fff;\n  color: #71717a;\n  font-size: 16px;\n  line-height: 1;\n  pointer-events: none;\n  transform: translateY(-50%);\n  transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease;\n}\n\n.outlined input:hover {\n  border-color: #52525b;\n}\n\n.outlined input:focus {\n  border-color: var(--accent);\n  box-shadow: inset 0 0 0 1px var(--accent);\n}\n\n.outlined input:focus + span,\n.outlined input:not(:placeholder-shown) + span {\n  top: 0;\n  font-size: 12px;\n}\n\n.outlined input:focus + span {\n  color: var(--accent);\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .outlined span {\n    transition: none;\n  }\n}",
  "features": [
    "transitions",
    "transforms",
    "box shadows",
    "custom properties",
    "reduced-motion support"
  ],
  "customProperties": [
    {
      "name": "--accent",
      "value": "#0d9488"
    }
  ]
}
