{
  "id": "price-range-slider",
  "name": "Price Range Slider",
  "category": "forms",
  "tags": [
    "dual range",
    "min max",
    "price filter",
    "two thumbs",
    "slider",
    "ecommerce"
  ],
  "description": "A dual-handle price filter built from two stacked range inputs where only the thumbs catch the pointer.",
  "url": "https://copy-css.com/snippets/price-range-slider",
  "markdown": "https://copy-css.com/snippets/price-range-slider.md",
  "html": "<fieldset class=\"price-range\">\n  <legend>Price</legend>\n  <div class=\"price-range-track\">\n    <input type=\"range\" min=\"0\" max=\"500\" step=\"10\" value=\"80\" aria-label=\"Minimum price\">\n    <input type=\"range\" min=\"0\" max=\"500\" step=\"10\" value=\"360\" aria-label=\"Maximum price\">\n  </div>\n  <p><span>$0</span><span>$500</span></p>\n</fieldset>",
  "css": ".price-range {\n  --thumb: 20px;\n  width: 260px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  color: #4a044e;\n  font-family: system-ui, sans-serif;\n}\n\n.price-range legend {\n  margin-bottom: 8px;\n  padding: 0;\n  font-size: 14px;\n  font-weight: 700;\n}\n\n.price-range-track {\n  position: relative;\n  height: var(--thumb);\n}\n\n.price-range-track::before {\n  content: \"\";\n  position: absolute;\n  top: 50%;\n  right: calc(var(--thumb) / 2);\n  left: calc(var(--thumb) / 2);\n  height: 4px;\n  border-radius: 999px;\n  background: #f5d0fe;\n  transform: translateY(-50%);\n}\n\n.price-range input {\n  position: absolute;\n  inset: 0;\n  width: 100%;\n  height: var(--thumb);\n  margin: 0;\n  background: none;\n  -webkit-appearance: none;\n  appearance: none;\n  pointer-events: none;\n}\n\n.price-range input::-webkit-slider-thumb {\n  width: var(--thumb);\n  height: var(--thumb);\n  border: 0;\n  border-radius: 50%;\n  background: #c026d3;\n  box-shadow: 0 0 0 4px #fff, 0 2px 6px 4px rgba(112, 26, 117, 0.25);\n  -webkit-appearance: none;\n  appearance: none;\n  pointer-events: auto;\n  cursor: grab;\n}\n\n.price-range input::-moz-range-thumb {\n  width: var(--thumb);\n  height: var(--thumb);\n  border: 0;\n  border-radius: 50%;\n  background: #c026d3;\n  box-shadow: 0 0 0 4px #fff, 0 2px 6px 4px rgba(112, 26, 117, 0.25);\n  pointer-events: auto;\n  cursor: grab;\n}\n\n.price-range input:focus-visible {\n  outline: none;\n}\n\n.price-range input:focus-visible::-webkit-slider-thumb {\n  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #c026d3;\n}\n\n.price-range input:focus-visible::-moz-range-thumb {\n  box-shadow: 0 0 0 4px #fff, 0 0 0 6px #c026d3;\n}\n\n.price-range p {\n  display: flex;\n  justify-content: space-between;\n  margin: 8px 0 0;\n  color: #a21caf;\n  font-size: 12px;\n}",
  "features": [
    "transforms",
    "box shadows",
    "Flexbox",
    "keyboard focus styles",
    "custom properties"
  ],
  "customProperties": [
    {
      "name": "--thumb",
      "value": "20px"
    }
  ]
}
